Awaken Scripting User Guide

Please email helpdesk@awaken.io for omissions or errors.
×
Menu

Genesys Cloud Script.Data Structure

 
When a Campaign has been popped from a Genesys Cloud interaction, the Script.Data layer will contain a synthesis of the event data object from Genesys Cloud as well as other data from Genesys Cloud, and related data generated within Scripting.
 
Three keys within the Script.Data layer specifically impact the end-of-Workflow behaviour:
 
Note: all of the provided data structures in this article are representative of common scenarios, and may vary over the course of an interaction, or depend directly on the data returned by a Genesys Cloud API. It is recommended that the structure be confirmed against your specific usage cases.
 

Email

When popping from an email interaction, the Script.Data layer is derived from a response from a Genesys Cloud API:
 
Below is an example data structure:
{
     "conversationId": "<Conversation GUID>",
     "agentParticipantId": "<Agent participant GUID>",
     "customerParticipantId": "<Customer participant GUID>",
     "awakenDisconnectOnClose": <Boolean>,
     "awakenOutcomeCode": "<Conversation wrap-up to be set string>",
     "awakenOutcomeComments": "<Conversation notes to be set string>",
     "customerEmail": {
          "id": "<Message GUID>",
          "to": [
               {
                    "email": "<Recipient email string>",
                    "name": "<Recipient email string>"
               }
          ],
          "cc": [{...}],
          "bcc": [{...}],
          "from": {
               "email": "<Sender email string>",
               "name": "<Sender name string>"
          },
          "subject": "<Email subject string>",
          "attachments": [
               {
                    "attachmentId": "<Attachment ID string>",
                    "name": "<Attachment filename string>",
                    "contentUri": "<Attachment path string>",
                    "contentType": "<Attachment MIME type string>",
                    "contentLength": <Attachment size in bytes integer>,
                    "inlineImage": <Boolean>
               }
          ],
          "textBody": "<Email body plaintext string>",
          "htmlBody": "<Email body HTML string>",
          "time": "<ISO 8601 datetime string>",
          "historyIncluded": <Boolean>,
          "selfUri": "/api/v2/conversations/emails/<Conversation GUID>/messages/<Message GUID>"
     }
}
 
 

Inbound

When popping from an inbound phone interaction, the Script.Data layer is derived from a subset of the conversation's data:
 
Below is an example data structure:
{
     "conversationId": "<Conversation GUID>",
     "agentParticipantId": "<Agent participant GUID>",
     "customerParticipantId": "<Customer participant GUID>",
     "awakenDisconnectOnClose": <Boolean>,
     "awakenOutcomeCode": "<Conversation wrap-up to be set string>",
     "awakenOutcomeComments": "<Conversation notes to be set string>",
     "agentCall": {
          "id": "<Agent participant GUID>",
          "state": "<State string>",
          "recording": <Boolean>,
          "recordingState": "<State string>",
          "muted": <Boolean>,
          "confined": <Boolean>,
          "held": <Boolean>,
          "direction": "inbound",
          "self": {
               "nameRaw": "<Agent username string>",
               "addressNormalized": "<Agent normalised address string>",
               "addressRaw": "<Agent raw address string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "other": {
               "name": "<Customer name string>",
               "nameRaw": "<Customer raw name string>",
               "addressNormalized": "<Customer normalised address string>",
               "addressRaw": "<Customer raw address string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "provider": "Edge",
          "peerId": "<Peer GUID>",
          "connectedTime": "<ISO 8601 datetime string>",
          "afterCallWorkRequired": <Boolean>,
          "additionalProperties": {}
     },
     "customerCall": {
          "id": "<Customer participant GUID>",
          "state": "<State string>",
          "recording": <Boolean>,
          "recordingState": "<State string>",
          "muted": <Boolean>,
          "confined": <Boolean>,
          "held": <Boolean>,
          "direction": "inbound",
          "self": {
               "name": "<Customer name string>",
               "nameRaw": "<Customer raw name string>",
               "addressNormalized": "<Customer normalised address string>",
               "addressRaw": "<Customer raw address string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "other": {
               "name": "<Name string>",
               "nameRaw": "<Name raw string>",
               "addressNormalized": "<Normalised address the customer dialled string>",
               "addressRaw": "<Raw address the customer dialled string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "provider": "Edge",
          "connectedTime": "<ISO 8601 datetime string>",
          "afterCallWorkRequired": <Boolean>,
          "additionalProperties": {}
     }
}
 
 

Outbound - Predictive

When popping from an outbound predictive interaction, the Script.Data layer is derived from a subset of the conversation's data and the response from a pair of Genesys Cloud APIs:
{
     "conversationId": "<Conversation GUID>",
     "agentParticipantId": "<Agent participant GUID>",
     "customerParticipantId": "<Customer participant GUID>",
     "awakenDisconnectOnClose": <Boolean>,
     "awakenOutcomeCode": "<Conversation wrap-up to be set string>",
     "awakenOutcomeComments": "<Conversation notes to be set string>",
     "dialerInteractionId": "<Preview interaction GUID>",
     "dialerCampaignId": "<Preview campaign GUID>",
     "dialerContactListId": "<Contact list GUID>",
     "dialerContactId": "<Contact list ID string>",
     "dialingMode": "predictive",
     "agentCall": {
          "id": "<Agent participant GUID>",
          "state": "<State string>",
          "recording": <Boolean>,
          "recordingState": "<State string>",
          "muted": <Boolean>,
          "confined": <Boolean>,
          "held": <Boolean>,
          "direction": "inbound",
          "self": {
               "nameRaw": "<Agent username string>",
               "addressNormalized": "<Agent normalised address string>",
               "addressRaw": "<Agent raw address string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "other": {
               "name": "<Customer name string>",
               "nameRaw": "<Customer raw name string>",
               "addressNormalized": "<Customer normalised address string>",
               "addressRaw": "<Customer raw address string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "provider": "Edge",
          "peerId": "<Peer GUID>",
          "connectedTime": "<ISO 8601 datetime string>",
          "afterCallWorkRequired": <Boolean>,
          "additionalProperties": {}
     },
     "customerCall": {
          "id": "<Customer participant GUID>",
          "state": "<State string>",
          "recording": <Boolean>,
          "recordingState": "<State string>",
          "muted": <Boolean>,
          "confined": <Boolean>,
          "held": <Boolean>,
          "direction": "inbound",
          "self": {
               "name": "<Customer name string>",
               "nameRaw": "<Customer raw name string>",
               "addressNormalized": "<Customer normalised address string>",
               "addressRaw": "<Customer raw address string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "other": {
               "name": "<Name string>",
               "nameRaw": "<Name raw string>",
               "addressNormalized": "<Normalised address the customer dialled string>",
               "addressRaw": "<Raw address the customer dialled string>",
               "addressDisplayable": "<Displayable string>",
               "additionalProperties": {}
          },
          "provider": "Edge",
          "peerId": "<Peer GUID>",
          "connectedTime": "<ISO 8601 datetime string>",
          "afterCallWorkRequired": <Boolean>,
          "additionalProperties": {}
     },
     "outboundContact": {
          "id": "<Contact ID string>",
          "contactListId": "<Contact list GUID>",
          "data": {...},
          "callable": <Boolean>,
          "phoneNumberStatus": {
               "Phone": {
                    "callable": <Boolean>
               }
          },
          "selfUri": "/api/v2/outbound/contactlists/<Contact list GUID>/contacts/<Contact ID string>"
     },
     "outboundCampaign": {
          "id": "<Campaign GUID>",
          "name": "<Campaign name string>",
          "dateCreated": "<ISO 8601 datetime string>",
          "dateModified": "<ISO 8601 datetime string>",
          "version": <Integer>,
          "contactList": {
               "id": "<Contact list GUID>",
               "name": "<Contact list name string>",
               "selfUri": "/api/v2/outbound/contactlists/<Contact list GUID>"
          },
          "queue": {
               "id": "<Queue GUID>",
               "name": "<Queue name string>",
               "selfUri": "/api/v2/routing/queues/<Queue GUID>"
          },
          "dialingMode": "predictive",
          "script": {
               "id": "<Script GUID>",
               "name": "<Script name string>",
               "selfUri": "/api/v2/scripts/published/<Script GUID>"
          },
          "site": {
               "id": "<Site GUID>",
               "name": "<Site name string>",
               "selfUri": "/api/v2/telephony/providers/edges/sites/<Site GUID>"
          },
          "campaignStatus": "<Status string>",
          "phoneColumns": [
               {
                    "columnName": "<Name string>",
                    "type": "<Type string>"
               }
          ],
          "abandonRate": <Integer>,
          "dncLists": [],
          "callAnalysisResponseSet": {
               "id": "<Response set GUID>",
               "name": "<Response set name string>",
               "selfUri": "/api/v2/outbound/callanalysisresponsesets/<Response set GUID>"
          },
          "callerName": "<Contact name string>",
          "callerAddress": "<E.164-formatted phone number string>",
          "outboundLineCount": <Integer>,
          "ruleSets": [],
          "skipPreviewDisabled": <Boolean>,
          "previewTimeOutSeconds": <Integer>,
          "singleNumberPreview": <Boolean>,
          "alwaysRunning": <Boolean>,
          "noAnswerTimeout": <Integer>,
          "priority": <Integer>,
          "contactListFilters": [],
          "division": {
               "id": "<Division GUID>",
               "name": "<Division name string>",
               "selfUri": "/api/v2/authorization/divisions/<Division GUID>"
          },
          "selfUri": "/api/v2/outbound/campaigns/<Campaign GUID>"
     }
}
 
 

Outbound - Preview

When popping from an outbound preview interaction, the Script.Data layer is derived from a subset of the conversation's data and the response from a pair of Genesys Cloud APIs:
 
Below is an example data structure:
{
     "conversationId": "<Conversation GUID>",
     "agentParticipantId": "<Agent participant GUID>",
     "customerParticipantId": "<Customer participant GUID>",
     "awakenDisconnectOnClose": <Boolean>,
     "awakenOutcomeCode": "<Conversation wrap-up to be set string>",
     "awakenOutcomeComments": "<Conversation notes to be set string>",
     "dialerInteractionId": "<Preview interaction GUID>",
     "dialerCampaignId": "<Campaign GUID>",
     "dialerContactListId": "<Contact list GUID>",
     "dialerContactId": "<Contact ID string>",
     "dialingMode": "preview",
     "agentCallback": {
          "state": "<Callback state string>",
          "id": "<Callback GUID>",
          "held": <Boolean>,
          "dialerPreview": {
               "id": "<Preview interaction GUID>",
               "contactId": "<Contact ID string>",
               "contactListId": "<Contact list GUID>",
               "campaignId": "<Campaign GUID>",
               "phoneNumberColumns": [
                    {
                         "columnName": "<Contact column name string>",
                         "type": "<Contact column type string>",
                         "additionalProperties": {}
                    }
               ],
               "additionalProperties": {}
          },
          "callbackNumbers": [
               "<E.164-formatted phone number string>"
          ],
          "callbackUserName": "Customer",
          "scriptId": "<Script GUID>",
          "peerId": "<Peer GUID>",
          "externalCampaign": <Boolean>,
          "skipEnabled": <Boolean>,
          "provider": "PureCloud Callback",
          "timeoutSeconds": <Integer>,
          "connectedTime": "<ISO 8601 datetime string>",
          "afterCallWorkRequired": <Boolean>,
          "additionalProperties": {}
     },
     "outboundContact": {
          "id": "<Contact ID string>",
          "contactListId": "<Contact list GUID>",
          "data": {...},
          "callable": <Boolean>,
          "phoneNumberStatus": {
               "Phone": {
                    "callable": <Boolean>
               }
          },
          "selfUri": "/api/v2/outbound/contactlists/<Contact list GUID>/contacts/<Contact ID string>"
     },
     "outboundCampaign": {
          "id": "<Campaign GUID>",
          "name": "<Campaign name string>",
          "dateCreated": "<ISO 8601 datetime string>",
          "dateModified": "<ISO 8601 datetime string>",
          "version": <Integer>,
          "contactList": {
               "id": "<Contact list GUID>",
               "name": "<Contact list name string>",
               "selfUri": "/api/v2/outbound/contactlists/<Contact list GUID>"
          },
          "queue": {
               "id": "<Queue GUID>",
               "name": "<Queue name string>",
               "selfUri": "/api/v2/routing/queues/<Queue GUID>"
          },
          "dialingMode": "preview",
          "script": {
               "id": "<Script GUID>",
               "name": "<Script name string>",
               "selfUri": "/api/v2/scripts/published/<Script GUID>"
          },
          "campaignStatus": "<Status string>",
          "phoneColumns": [
               {
                    "columnName": "<Name string>",
                    "type": "<Type string>"
               }
          ],
          "abandonRate": <Integer>,
          "dncLists": [],
          "callerName": "<Contact name string>",
          "callerAddress": "<E.164-formatted phone number string>",
          "outboundLineCount": <Integer>,
          "ruleSets": [],
          "skipPreviewDisabled": <Boolean>,
          "previewTimeOutSeconds": <Integer>,
          "singleNumberPreview": <Boolean>,
          "alwaysRunning": <Boolean>,
          "noAnswerTimeout": <Integer>,
          "priority": <Integer>,
          "contactListFilters": [],
          "division": {
               "id": "<Division GUID>",
               "name": "<Division name string>",
               "selfUri": "/api/v2/authorization/divisions/<Division GUID>"
          },
          "selfUri": "/api/v2/outbound/campaigns/<Campaign GUID>"
     },
     "dialerPreview": {
          "id": "<Preview interaction GUID>",
          "contactId": "<Contact ID string>",
          "contactListId": "<Contact list GUID>",
          "campaignId": "<Campaign GUID>",
          "phoneNumberColumns": [
               {
                    "columnName": "<Contact column name string>",
                    "type": "<Contact column type string>",
                    "additionalProperties": {}
               }
          ],
          "additionalProperties": {}
     }
}
 
 

Web Chat

When popping from a web chat interaction, the Script.Data layer is derived from a subset of the conversation's data and the response from a Genesys Cloud API:
 
Below is an example data structure, showing three message items (join, message, and leave) and the default awakenPopCampaign keyname used to specify the Campaign to be popped:
{
     "conversationId": "<Conversation GUID>",
     "agentParticipantId": "<Agent participant GUID>",
     "customerParticipantId": "<Customer participant GUID>",
     "awakenDisconnectOnClose": <Boolean>,
     "awakenOutcomeCode": "<Conversation wrap-up to be set string>",
     "awakenOutcomeComments": "<Conversation notes to be set string>",
     "agentChat": {
          "state": "connected",
          "id": "<Agent chat GUID>",
          "provider": "PureCloud Webchat v2",
          "held": <Boolean>,
          "connectedTime": "<ISO 8601 datetime string>",
          "afterCallWorkRequired": <Boolean>,
          "additionalProperties": {}
     },
     "customerChat": {
          "state": "connected",
          "id": "<Customer chat GUID>",
          "provider": "PureCloud Webchat v2",
          "held": <Boolean>,
          "connectedTime": "<ISO 8601 datetime string>",
          "afterCallWorkRequired": <Boolean>,
          "additionalProperties": {},
          "attributes": {
               "context.awakenPopCampaign": "<Targeted Awaken campaign>",
               "context._genesys_url": "<Chat widget's source URL>",
               "context._genesys_source": "web",
               "context._genesys_pageTitle": "",
               ...
          },
          ...
     },
     "chatData": {
          "lastCustomerMessage": "<Message string>",
          "messages": [
               {
                    "id": "<Message GUID>",
                    "conversation": {
                         "id": "<Conversation GUID>",
                         "selfUri": "/api/v2/conversations/<Conversation GUID>"
                    },
                    "sender": {
                         "id": "<Chat participant GUID>"
                    },
                    "bodyType": "member-leave",
                    "timestamp": "<ISO 8601 datetime string>",
                    "selfUri": "/api/v2/conversations/chats/<Conversation GUID>/messages/<Message GUID>"
               },
               {
                    "id": "<Message GUID>",
                    "conversation": {
                         "id": "<Conversation GUID>",
                         "selfUri": "/api/v2/conversations/<Conversation GUID>"
                    },
                    "sender": {
                         "id": "<Chat participant GUID>"
                    },
                    "body": "<Message string>",
                    "bodyType": "standard",
                    "timestamp": "<ISO 8601 datetime string>",
                    "selfUri": "/api/v2/conversations/chats/<Conversation GUID>/messages/<Message GUID>"
               },
               {
                    "id": "<Message GUID>",
                    "conversation": {
                         "id": "<Conversation GUID>",
                         "selfUri": "/api/v2/conversations/<Conversation GUID>"
                    },
                    "sender": {
                         "id": "<Chat participant GUID>"
                    },
                    "bodyType": "member-join",
                    "timestamp": "<ISO 8601 datetime string>",
                    "selfUri": "/api/v2/conversations/chats/<Conversation GUID>/messages/<Message GUID>"
               }
          ],
          "customerActive": <Boolean>
     }
}