Skip to main content

Widget API Events

The Widget API exposes the onDataEvent method to allow widgets to subscribe to various data events delivered by Workspaces.

note

Events marked as Requires Interaction require an interaction context. Any Widget leveraging these events must be placed on an Interaction related tab (for example, Customer Details).

// Subscribing to an event
var event = 'onInteractionEvent';
api.onDataEvent(event, callback);
function callback(data) {
// do something with event data
}
// Unsubscribing from an event
var event = 'onInteractionEvent';
api.removeDataEvent(event);
// Unsubscribing from all events
api.removeAllDataEvents(event);

onAgentStateEvent#

AXPAXP Connect

This event is triggered whenever the agent state changes. This event provides information to widgets on the current state and reason codes as well as the agent's current capabilities.

api.onDataEvent('onAgentStateEvent', callback);
function callback(data) {
// do something with event data
}

Payload

{
"resourceStates": {
"EMAIL": {
"state": "NOT_READY",
"stateReason": "100",
"capabilities": {
"canCancelCallForwarding": false,
"canDefer": true,
"canRetrieveInteractions": false,
"canSetCallForwarding": false,
"canStartInteraction": true,
"canStartSupervisorInteraction": false,
"canSupervisorRetrieveInteractions": false
},
"resourceAddress": "600008_Email",
"providerId": "1e960255-445c-4a9d-a5e6-b4e35af29c81"
},
"VOICE": {
"state": "NOT_READY",
"stateReason": "0",
"capabilities": {
"canCancelCallForwarding": true,
"canDefer": false,
"canRetrieveInteractions": false,
"canSetCallForwarding": true,
"canStartAgentToAgentInteraction": true,
"canStartInteraction": true,
"canStartSupervisorInteraction": true,
"canStartSupervisorToAgentInteraction": true,
"canSupervisorRetrieveInteractions": false
},
"resourceAddress": "600008",
"providerId": "454002bb-dd92-4fb4-afbb-a4a264341600"
},
"WEBCHAT": {
"state": "NOT_READY",
"stateReason": "100",
"capabilities": {
"canCancelCallForwarding": false,
"canDefer": false,
"canRetrieveInteractions": false,
"canSetCallForwarding": false,
"canStartInteraction": false,
"canStartSupervisorInteraction": false,
"canSupervisorRetrieveInteractions": false
},
"resourceAddress": "600008_WebChat",
"providerId": "66e5ab55-805a-45cd-826a-3d906b05c29d"
}
},
"currentState": "NOT_READY",
"previousState": "READY",
"capabilities": {
"canDeactivate": false,
"canLogin": false,
"canLogout": true,
"canMentorChat": true,
"canMentorMessaging": true,
"canMentorSMS": true,
"canMentorVoice": true,
"canMonitorTeamMember": true,
"canSetAfterContactWork": true,
"canSetNotReady": false,
"canSetReady": false,
"canSetWorkMode": false,
"canSupervisorDeactivate": false,
"canSupervisorLogout": true,
"canSupervisorSetNotReady": false,
"canSupervisorSetReady": false
},
"lastStateChangeTime": "2023-10-19T11:48:12.688356092Z",
"originStates": {
"AXP": {
"origin": "AXP",
"state": "NOT_READY",
"stateReason": "700",
"reasonCode": "700",
"lastStateChangeTime": "2023-10-19T11:48:12.688356092Z",
"capabilities": {
"canDeactivate": false,
"canLogin": false,
"canLogout": true,
"canMentorChat": true,
"canMentorMessaging": true,
"canMentorSMS": true,
"canMentorVoice": true,
"canMonitorTeamMember": true,
"canSetAfterContactWork": true,
"canSetNotReady": true,
"canSetReady": false,
"canSetWorkMode": false,
"canSupervisorDeactivate": false,
"canSupervisorLogout": true,
"canSupervisorSetNotReady": false,
"canSupervisorSetReady": false
}
},
"ELITE": {
"origin": "ELITE",
"state": "NOT_READY",
"stateReason": "0",
"reasonCode": "0",
"lastStateChangeTime": "2023-10-19T11:45:50.898567597Z",
"capabilities": {
"canDeactivate": false,
"canLogin": false,
"canLogout": true,
"canMentorChat": true,
"canMentorMessaging": true,
"canMentorSMS": true,
"canMentorVoice": true,
"canMonitorTeamMember": true,
"canSetAfterContactWork": false,
"canSetNotReady": true,
"canSetReady": true,
"canSetWorkMode": false,
"canSupervisorDeactivate": false,
"canSupervisorLogout": true,
"canSupervisorSetNotReady": false,
"canSupervisorSetReady": false
}
}
},
"reasonCode": "700",
"type": "[Agent] Gone Not Ready"
}

onAnyInteractionEndedEvent#

AXPAXP Connect

This event is triggered when any work card (interaction) has been ended.

api.onDataEvent('onAnyInteractionEndedEvent', function (data) {
scope.currentState = data.state;
});

Payload

{
"id": "bffae854-9219-4cfc-9fd3-7125f2e76844",
"workRequestId": "00142002901551796576",
"externalInteractionId": "14221",
"channel": "VOICE",
"state": "ACTIVE",
"stateReason": "DEFAULT",
"interactionType": "CALLED",
"title": "Stella Pavlova",
"topic": "Support",
"topicId": "3007",
"skill": "IT",
"skillId": "3009",
"direction": "INCOMING",
"isCustomerInteraction": false,
"isWebRtcCall": false,
"userToUserInfo": "172917",
"isConsult": false,
"workCode": "7277",
"originatingAddress": "14225",
"destinationAddress": "14221",
"contactId": "00142002901551796576"
}

onAnyInteractionEvent#

AXPAXP Connect

This event is triggered when any new work card (interaction) appears in Workspaces. It is also triggered each time any interaction is updated.

This event is designed to be used by widgets that wish to listen out for all interaction events.

note

If multiple interactions are updated or created at the same time then this event will fire multiple times.

api.onDataEvent('onAnyInteractionEvent', function (data) {
scope.currentState = data.state;
});

Payload

{
"id": "bffae854-9219-4cfc-9fd3-7125f2e76844",
"workRequestId": "00142002901551796576",
"externalInteractionId": "14221",
"channel": "VOICE",
"state": "ALERTING",
"stateReason": "DEFAULT",
"interactionType": "CALLED",
"title": "Stella Pavlova",
"topic": "Support",
"topicId": "3007",
"skill": "IT",
"skillId": "3009",
"direction": "INCOMING",
"isCustomerInteraction": false,
"isWebRtcCall": false,
"userToUserInfo": "172917",
"isConsult": false,
"workCode": "7277",
"originatingAddress": "14225",
"destinationAddress": "14221",
"contactId": "00142002901551796576"
}

onCapabilitiesEvent#

AXPAXP Connect

This event is triggered when the agent or interaction capabilities have been updated.

note

You can also use the getCapabilities API method to retrieve the latest capabilities at any time.

api.onDataEvent('onCapabilitiesEvent', callback);
function callback(data) {
// do something with event data
}

Payload

{
canDeactivate: false
canLogin: false
canLogout: true
canMentorChat: true
canMentorMessaging: true
canMentorSMS: true
canMentorVoice: true
canMonitorTeamMember: true
canSetAfterContactWork: true
canSetNotReady: true
canSetReady: false
canSetWorkMode: false
canSupervisorDeactivate: false
canSupervisorLogout: true
canSupervisorSetNotReady: true
canSupervisorSetReady: false
}

onCardFocusedEvent#

AXPAXP Connect

This event is triggered when the interaction is focused.

api.onDataEvent('onCardFocusedEvent', callback);
function callback(data) {
// We can do something when an interaction is focused
}

See the hello-world sample widget for further demonstration.

onChannelStatusUpdateEvent#

AXPAXP Connect

This event is triggered when the status of a channel on a Custom State Panel gets updated.

api.onDataEvent('onChannelStatusUpdateEvent', function (data) {
if (data.ready){
console.log(data.name + ' is ready');
} else {
console.log(data.name + ' is not ready');
}
// do something with event data
});

Payload

{
"name": "Chat"
"notReadyIcon": "aoc-chat-missed"
"ready": false
"readyIcon": "aoc-chat"
"reasonCode": "Lunch"
}

onContextDataEvent#

AXPAXP Connect

This event is triggered when customer and context data is available in Chat, SMS, Messaging, Email and Social work cards. You can use this event to obtain customer details and customer history data from Chat, SMS, Messaging, Email and Social interactions.

note

Here you can retrieve max allowed characters limitations (which is best to manage in your widget) using clientValidation array passed within common data object. Depending on your interaction channel (Chat, SMS or Social) you are going to get different validation entries with data.type field equal to WEBCHAT_MAX_CHAR, SMS_MAX_CHAR or SOCIAL_MAX_CHAR respectively.

note

Requires Interaction

api.onDataEvent('onContextDataEvent', callback);
function callback(data) {
// do something with event data
}

Payload

{
"interactionId": "6194c3ef-676d-4743-a2a5-a86f5591ceer",
"clientValidation": [{
"data": {
"type": "WEBCHAT_MAX_CHAR",
"value": 10000
},
"type": "CLIENT_VALIDATION",
"description": "",
"id": "6194c3ef-676d-4743-a2a5-a86f5591ce52"
}],
"customerDetails": [{
"type": "CUSTOMER_DETAILS",
"data": {
"name": "name1",
"firstName": "firstName1",
"lastName": "lastName1",
"email": "customer@companyxyz.com",
"phonePrimary": "phonePrimary1",
"phoneHome": "phoneHome1",
"phoneMobile": "phoneMobile1",
"phoneFax": "phoneFax1",
"birthDate": "birthDate1",
"address": "address1",
"addressStreet": "addressStreet1",
"addressState": "addressState1",
"addressZip": "addressZip1",
"addressCity": "addressCity1",
"addressCountry": "addressCountry1",
"geoLatitude": "geoLatitude1",
"geoLongitude": "geoLongitude1",
"avatarUrl": "avatarUrl1",
"title": "title1",
"description": "description1",
"department": "department1",
"createdDate": "2017-09-19T12:45:10.763Z"
},
"description": "",
"id": "87e79cf5-cfee-4960-b776-fa449ae1a98e"
}],
"customerHistory": [{
"type": "CUSTOMER_HISTORY",
"data": {
"status": "status1",
"subject": "subject1",
"priority": "priority1",
"type": "type1",
"href": "https://10.134.146.163/services/AgentControllerService/gila/api/customerhistory/12234",
"createdDate": "2017-09-19T12:45:10.763Z"
},
"description": "",
"id": "f514d6eb-58c3-4750-bb26-f0840b76dd37"
},
{
"type": "CUSTOMER_HISTORY",
"data": {
"status": "status2",
"subject": "subject2",
"priority": "priority2",
"type": "type2",
"href": "https://10.134.146.163/services/AgentControllerService/gila/api/customerhistory/12771",
"action": "action1",
"id": "id1",
"createdDate": "2017-09-19T12:45:10.763Z"
},
"description": "",
"id": "96d633e2-9f26-40b9-bf9c-3fbf5241dec3"
}
],
"contextStore": [{
"type": "CONTEXT_STORE",
"data": "716391",
"description": "Prompted Digits Data",
"id": "a9a65201-0c72-4c1f-8735-9635f064a016"
}],
"campaignScripts": [{
"type": "CAMPAIGN_SCRIPT",
"description": "",
"id": "a98416b5-f071-415c-9dfb-5e04af2c70cf",
"data": "https://irishtimes.com"
}],
"cobrowse": [{
"type": "COBROWSE",
"id": "45d8c424-796c-466d-8846-41a73c0f43b5",
"data": {
"url": "http://10.134.146.71/services/cobrowse/customer/index.html",
"description": "Cobrowse welcome page"
}
}],
"fromAddresses": [{
"type": "ORIGINATOR",
"data": {
"address": "info@info.com",
"description": "text1"
},
"description": "",
"id": "9e9c21d6-dc9e-4603-9046-fe8678d18b8a"
},
{
"type": "ORIGINATOR",
"data": {
"address": "sales@sales.com",
"description": "text2"
},
"description": "",
"id": "863bb132-912c-4013-93e3-8c2af6062dd2"
}
],
"pagePushUrl": [{
"type": "PAGE_PUSH",
"data": {
"description": "description1",
"url": "url1"
},
"id": "dcb5e8ea-0d24-42fc-97ab-524f60e1991d"
},
{
"type": "PAGE_PUSH",
"data": {
"description": "description2",
"url": "url2"
},
"id": "3d47b685-1167-44f0-8912-1d06d6a8bc21"
}
],
"screenPop": [{
"type": "SCREEN_POP",
"id": "b6a9bc1c-ece7-4379-8c39-aaf5d46452c7",
"data": {
"action": "NONE",
"name": "Maps",
"scope": "INTERNAL",
"trigger": "ACTIVE",
"uri": "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d152660.05036353657!2d-9.188836092077002!3d53"
}
},
{
"type": "SCREEN_POP",
"id": "7eb9082e-9bcf-45a9-a033-406a16961303",
"data": {
"action": "CLOSE_ON_END",
"name": "Google",
"scope": "INTERNAL",
"trigger": "ACTIVE",
"uri": "http://www.google.com"
}
}
],
"suggestedPhrase": [{
"type": "SUGGESTED_PHRASE",
"data": {
"name": "name1",
"text": "text1"
},
"description": "",
"id": "962641e5-544c-4eff-9321-3546a0511f0c"
},
{
"type": "SUGGESTED_PHRASE",
"data": {
"name": "name2",
"text": "text2"
},
"description": "",
"id": "78ccd9c3-326f-436b-adb3-3e922f9937b0"
}
],
"Agent ID": "10002",
"Station ID": "1002",
"textDir": "rtl"
}

onCustomCardEndedEvent#

AXPAXP Connect

This event is triggered when a custom interaction has been ended.

api.onDataEvent('onCustomCardEndedEvent', function (data) {
// do something with the event data
console.log(data);
});

Payload

{
"id": "1234";
"widgetId": "4567";
"title": "Custom Card";
"summary": "Test Summary";
"state": "CUSTOM STATE";
"channel": "Custom";
"titleTooltip": "Custom tooltip";
"cardButtons": [];
"icon": "custom";
"iconTooltip": "custom icon tooltip";
"color": "blue";
"establishedTime": 1293938403992;
"updatableTimer": true;
"updateTimestamp": 1293938403992;
"countdownTimer": true;
"countdownDuration": 30;
"panelButtons": [];
"interactionData": {};
"focusOnCreated": true;
"menuTimeout": 8000;
"customShortcuts": [];
"disableDefaultTabActivation": true;
"isTimerDisabled": false;
"legTitleIcon": "icon";
"legTitleTooltip": "tooltip";
}

onEmailAttachmentUploadEvent#

AXP

This event is triggered after an email attachment upload to the server has been completed.

note

Requires Interaction

api.onDataEvent('onEmailAttachmentUploadEvent', function (data) {
// do something with the event data
console.log(data);
});

Payload

{
"attachments": [
{
"partId": "5399B8DF-7038-42B6-9F67-64B9C178D132",
"mimeType": "image/jpeg",
"name": "test_img.JPG",
"size": 8233,
"address": "http://localhost/services/AgentControllerService/attachment/5399B8DF-7038-42B6-9F67-64B9C178D132",
"parentId": "6194c3ef-676d-4743-a2a5-a86f5593453f"
}
]
}

onInteractionEndedEvent#

AXPAXP Connect

This event is triggered when a work card (interaction) has been ended. This occurs for all interaction types.

note

Requires Interaction

note

This event is only useful when ACW is enabled so that the widget can be used to trigger some custom logic when an interaction has ended. Otherwise, as per usual, the widget is destroyed once the interaction has ended. If this is seen as a limitation to your widget development, you can try using the onAnyInteractionEndedEvent which fires when any interaction has ended.

note

This client side only event is quite limited as the backend does not support an ENDED interaction state, only ALERTING, ACTIVE, and HELD. Therefore, you will see that the event is triggered in the following scenarios for Voice:

  • Agent ends the call.
  • Customer ends the call.
  • Call is blind transferred (single step transfer).
  • Agent A consults Agent B, then Agent A completes as conference (in this case the interactionType can be used to check for a value of 'CONSULTING').
  • Agent A consults Agent B, then Agent A completes as transfer (same as above, the interactionType can be used if required).
api.onDataEvent('onInteractionEndedEvent', function (data) {
// do something with the event data
console.log(data);
});

Payload

{
"id": "bffae854-9219-4cfc-9fd3-7125f2e76844",
"workRequestId": "00142002901551796576",
"externalInteractionId": "14221",
"channel": "VOICE",
"state": "ACTIVE",
"stateReason": "DEFAULT",
"interactionType": "CALLED",
"title": "Stella Pavlova",
"topic": "Support",
"topicId": "3007",
"skill": "IT",
"skillId": "3009",
"direction": "INCOMING",
"isCustomerInteraction": false,
"isWebRtcCall": false,
"userToUserInfo": "172917",
"isConsult": false,
"workCode": "7277",
"originatingAddress": "14225",
"destinationAddress": "14221",
"contactId": "00142002901551796576"
}

onInteractionEvent#

AXPAXP Connect

This event is triggered when a new work card (interaction) appears in Workspaces. It is also triggered each time the interaction is updated.

The state property can be used to determine what state the interaction is currently in (for example, ALERTING, ACTIVE, HELD).

note

Requires Interaction

api.onDataEvent('onInteractionEvent', function (data) {
// do something with the event data
console.log(data);
});

Payload

{
"id": "bffae854-9219-4cfc-9fd3-7125f2e76844",
"workRequestId": "00142002901551796576",
"externalInteractionId": "14221",
"channel": "VOICE",
"state": "ALERTING",
"stateReason": "DEFAULT",
"interactionType": "CALLED",
"title": "Stella Pavlova",
"topic": "Support",
"topicId": "3007",
"skill": "IT",
"skillId": "3009",
"direction": "INCOMING",
"isCustomerInteraction": false,
"isWebRtcCall": false,
"userToUserInfo": "172917",
"isConsult": false,
"workCode": "7277",
"originatingAddress": "14225",
"destinationAddress": "14221",
"contactId": "00142002901551796576"
}

onInteractionTabChange#

This event is triggered whenever the agent/supervisor switches the tab between customer and mentor so that we can put control over the templates and messages.

api.onDataEvent('onInteractionTabChange', callback);
function callback(data: boolean) {
// do something with event data
}

Payload

data: boolean

onMediaEvent#

AXP

This event is triggered when an incoming Chat, SMS, Messaging, Email or Social interaction is accepted by the user (Agent/Supervisor). You can use this event to obtain Chat, SMS, Messaging, Email or Social related data such as participants or previously sent media messages.

note

Requires Interaction

api.onDataEvent('onMediaEvent', callback);
function callback(data) {
// do something with event data
}

Payload

{
"interactionId": "803cdebe-a4b9-47d7-b0f6-27fa85dc654c",
"messages": [
{
"messageId": "9DBA8D4C-3BBD-435A-BEFC-031151146AA3",
"interactionMediaId": "02dc3a4c-6bdb-410e-8424-2fc26027884e",
"subject": "",
"body": "I would like to update some details on my car insurance policy.",
"arrivalDate": "2017-12-11T12:47:27.557Z",
"lastModifiedDate": "",
"receivedFrom": {
"participantType": "CUSTOMER",
"participantName": "Josh Davis",
"participantAddress": "(503) 421-9800",
"muted": false,
"isSelf": false
},
"messageEvent": null,
"flags": {
"read": true,
"sensitivity": "CONFIDENTIAL",
"importance": "LOW"
},
"parts": [],
"sendTo": [],
"type": "WEBCHAT",
"chatMessageEvent": {
"subject": "messageEventSubject",
"participants": [
{
"participantType": "AGENT",
"participantName": "Name Steve",
"participantAddress": "1003",
"muted": false,
"isSelf": true
},
{
"participantType": "CUSTOMER",
"participantName": "Josh Davis",
"participantAddress": "(503) 421-9800",
"muted": false,
"isSelf": false
}
],
"chatEventType": "MESSAGE"
},
"read": true,
"sensitivity": "CONFIDENTIAL",
"importance": "LOW"
}
],
"participants": [
{
"participantType": "AGENT",
"participantName": "Name Steve",
"participantAddress": "1003",
"muted": false,
"isSelf": true
},
{
"participantType": "CUSTOMER",
"participantName": "Josh Davis",
"participantAddress": "(503) 421-9800",
"muted": false,
"isSelf": false
}
]
}

onMediaMessageEvent#

AXP

This event is triggered when incoming Chat, SMS, Messaging, Social or Email messages are sent to the user (Agent/Supervisor). You can use this event to obtain Chat, SMS, Messaging or Social messages and pass them to the widget. In the case of Email, data is received as a single Email message and it can contain data formatted as text or HTML.

note

Requires Interaction

api.onDataEvent('onMediaMessageEvent', callback);
function callback(data) {
scope.chatMessage = data.body;
}

Payload

{
"messageId": "059BB79E-FED2-42A7-9FEC-FC230904B09F",
"interactionMediaId": "67313d2d-18fe-4c4b-a457-662c71eed99a",
"subject": "",
"body": "I would like to update some details on my car insurance policy.",
"arrivalDate": "2017-09-20T12:54:08.064Z",
"lastModifiedDate": "",
"receivedFrom": {
"participantType": "CUSTOMER",
"participantName": "Stella Pavlova",
"participantAddress": "(212) 842-5500",
"muted": false,
"isSelf": false
},
"messageEvent": null,
"flags": {
"read": true,
"sensitivity": "CONFIDENTIAL",
"importance": "LOW"
},
"parts": [],
"sendTo": [],
"type": "WEBCHAT",
"chatMessageEvent": {
"subject": "messageEventSubject",
"participants": [
{
"participantType": "AGENT",
"participantName": "Name Steve",
"participantAddress": "1002",
"muted": false,
"isSelf": true
},
{
"participantType": "CUSTOMER",
"participantName": "Stella Pavlova",
"participantAddress": "(212) 842-5500",
"muted": false,
"isSelf": false
}
],
"chatEventType": "MESSAGE"
},
"read": true,
"sensitivity": "CONFIDENTIAL",
"importance": "LOW"
}

onMessageEvent#

AXPAXP Connect

This event is triggered when other widgets broadcast a data message by using the sendMessage or sendMessageToAnyWidget API methods. This event is used primarily for inter-widget communication.

This event returns anything that is sent via the sendMessage or sendMessageToAnyWidget API methods

api.onDataEvent('onMessageEvent', callback);
function callback(data) {
// do something with event data
}

onNavigationEvent#

AXPAXP Connect

This event is triggered whenever an icon in the sidebar is clicked. This event can inform widgets whenever the user navigates or selects a sidebar icon.

api.onDataEvent('onNavigationEvent', callback);
function callback(data) {
// do something with event data
}

Payload

{
"id": "tab__1",
"name": "WelcomePage",
"tooltip": "WelcomePage",
"widgets": [
"<ws-team-viewer-widget widgetId=\"701f2a9f-706f-4e65-a7cf-108119cee2e1\"></ws-team-viewer-widget>",
"<ws-welcome-page widgetId=\"7c25ba08-33f1-4b76-a350-bfd229e0aece\"></ws-welcome-page>"
],
"layout": 1,
"iconUri": "neo-icon-home",
"roles": [
"AGENT",
"SUPERVISOR"
]
}

onParticipantsAdded#

AXP

This event is triggered when a participant is added to an interaction.

note

Requires Interaction

api.onDataEvent('onParticipantsAdded', callback);
function callback(data) {
// We can do something here with the new token
}

Payload

[
{
"type": "SUPERVISOR",
"subtype": "subtype",
"name": "Paul Newton",
"address": "600003",
"muted": true,
"isSelf": false,
},
{
"type": "CUSTOMER",
"subtype": "subtype",
"name": "Steve Von",
"address": "600659",
"muted": true,
"isSelf": false,
}
]

onRequestServicesEvent#

AXP

This event is triggered whenever there is a call to get latest services.

api.onDataEvent('onRequestServicesEvent', function (data) {
// do something with the event data
console.log(data);
});

Payload

[{
"id": "f775be25-68a0-4c54-9b10-a24f6cc4b5ff",
"name": "Sales",
},
{
"id": "f775be25-68a0-4c54-9b10-a24f6cc4b5bb",
"name": "IT"
}]

onResourceAcquiredEvent#

AXPAXP Connect

This event is triggered when resource is acquired. The object that is returned from this event is the acquired resource object.

api.onDataEvent('onResourceAcquiredEvent', callback);
function callback(data) {
// do something with acquired resource object
}

Payload

{
"channel": "MESSAGING",
"state": "NOT_READY",
"stationId": "phobosagent12@wta.com-Messaging",
"agentId": "phobosagent12@wta.com",
"providerId": "0a91078c-dcce-41e7-875a-553f10c2755c"
}

onResourceReleasedEvent#

AXPAXP Connect

This event is triggered when resource is released. The object that is returned from this event is the released resource object.

api.onDataEvent('onResourceReleasedEvent', callback);
function callback(data) {
// do something with released resource object
}

Payload

{
"channel": "VOICE",
"state": "READY",
"stationId": "10777",
"agentId": "phobosagent12@wta.com",
"providerId": "f260787c-a3b0-4a88-866b-a6e866c15894"
}

onSSOTokenRefreshEvent#

AXPAXP Connect

This event is triggered when the SSO token is refreshed.

api.onDataEvent('onSSOTokenRefreshEvent', callback);
function callback(data) {
// We can do something here with the new token
}

onTeamMemberEvent#

AXP

This event is triggered when a Team member event occurs. A Team member event consists of the following instances:

  • An agent activates.
  • A supervisor group is changed/updated by adding a new user into that supervisor group.
  • An agent's state changes.
  • In the case of a supervisor monitoring an agent, an event is also triggered when the state of an interaction is changed.

The object that is returned from this event is the agent object.

api.onDataEvent('onTeamMemberEvent', callback);
function callback(data) {
// do something with team member data
}

Payload

{
"userHandle":"mRuane",
"state":"READY",
"isConnected": false,
"isMonitored": false,
"isNew": false,
"isSelf": false,
"lastName": "6",
"lastStateChangeTime": undefined,
"resourceAddress": "",
"stateReason": "",
"type": "AGENT",
"capabilities":{
"canLogin":false,
"canSetNotReady":true,
"canLogout":true,
"canSetReady":false,
"canDeactivate":false,
"canSupervisorSetReady":false,
"canSupervisorSetNotReady":true,
"canSupervisorLogout":true
},
"interactions":[
{
"id":"738fbd59-3e07-47fd-af4e-a280c8a08c7a",
"state":"ACTIVE",
"channel":"WEBCHAT",
"direction":"INCOMING",
"created":"2018-05-01T12:39:58.901Z",
"establishedTime":"2018-05-01T12:39:58.901Z",
"topic":"Oceana Service",
"isCustomerInteraction":true,
"originatingAddress":"(014) 427-4427",
"destinationAddress":"1001",
"workRequestId":"0074518545435242185724",
"capabilities":{
"canReject":false,
"canSetUui":true,
"canConsult":false,
"canTransferComplete":false,
"canEnd":true,
"canConferenceComplete":false,
"canSetWorkCode":true,
"canSetDispositionCode":true,
"canExtendACW":false,
"canSingleStepTransfer":true,
"canSingleStepTransferToService":true,
"canUnmute":false,
"canUnhold":false,
"canCompleteACW":false,
"canMute":false,
"canSetACW":true,
"canHold":false,
"canIgnore":false,
"canAccept":false,
"canSendDtmf":false,
"canForward":true,
"canSendMessage":true,
"canObserve":true,
"canBarge":false,
"canCoach":false,
"canReply":true,
"canSingleStepConference":false,
"canDefer":false
},
"isObserved":false
}
],
"channels":[
{
"state":"READY",
"stateReason":"DEFAULT",
"reasonCode":"",
"providerName":"ngdemc",
"capabilities":{
"canSetCallForwarding":true,
"canCancelCallForwarding":true,
"canStartInteraction":true,
"canStartSupervisorInteraction":true
},
"channelType":"VOICE",
"id":"ad1cbec8-fe15-482b-8085-7d9c7f13f761",
"$$hashKey":"object:644"
},
{
"state":"READY",
"stateReason":"DEFAULT",
"reasonCode":"",
"providerName":"ngdemc",
"capabilities":{
"canSetCallForwarding":false,
"canCancelCallForwarding":false,
"canStartInteraction":false,
"canStartSupervisorInteraction":false
},
"channelType":"WEBCHAT",
"id":"0aeed53d-a50d-46bf-8e7d-681164d90746",
"$$hashKey":"object:645"
},
{
"state":"READY",
"stateReason":"DEFAULT",
"reasonCode":"",
"providerName":"ngdemc",
"capabilities":{
"canSetCallForwarding":false,
"canCancelCallForwarding":false,
"canStartInteraction":true,
"canStartSupervisorInteraction":false,
"canRetrieveInteractions":false
},
"channelType":"EMAIL",
"id":"8cc86248-c214-4b27-81b7-c4ae103b637b",
"$$hashKey":"object:639"
},
{
"state":"READY",
"stateReason":"DEFAULT",
"reasonCode":"",
"providerName":"ngdemc",
"capabilities":{
"canSetCallForwarding":false,
"canCancelCallForwarding":false,
"canStartInteraction":false,
"canStartSupervisorInteraction":false
},
"channelType":"SMS",
"id":"2872a9e0-0edc-4126-9b1c-05b22b2c8beb",
"$$hashKey":"object:641"
},
{
"state":"READY",
"stateReason":"DEFAULT",
"reasonCode":"",
"providerName":"ngdemc",
"capabilities":{
"canSetCallForwarding":false,
"canCancelCallForwarding":false,
"canStartInteraction":false,
"canStartSupervisorInteraction":false
},
"channelType":"SOCIAL",
"id":"bb58757e-6115-4ca8-bb57-9075d32fa697",
"$$hashKey":"object:642"
},
{
"state":"READY",
"stateReason":"DEFAULT",
"reasonCode":"",
"providerName":"ngdemc",
"capabilities":{
"canSetCallForwarding":true,
"canCancelCallForwarding":true,
"canStartInteraction":true,
"canStartSupervisorInteraction":true
},
"channelType":"VIDEO",
"id":"fefef219-05b0-4a46-9ad9-681e8e941edf",
"$$hashKey":"object:643"
},
{
"state":"READY",
"stateReason":"DEFAULT",
"reasonCode":"",
"providerName":"ngdemc",
"capabilities":{
"canSetCallForwarding":true,
"canCancelCallForwarding":true,
"canStartInteraction":true,
"canStartSupervisorInteraction":true
},
"channelType":"GENERIC",
"id":"dc3ad786-adef-4acb-8c56-8689e05dba72",
"$$hashKey":"object:640"
}
]
}

onUserTypingEvent#

AXP

This event is triggered when a user starts typing into the messenger input.

api.onDataEvent('onUserTypingEvent', function (data) {
// do something with the event data
console.log(data);
});

Payload

{
"interactionId": "f775be25-68a0-4c54-9b10-a24f6cc4b5bb";
"sensitivity": "PUBLIC";
"participant": {
"type": "AGENT",
"subtype": "",
"name": "Tessie Corkery",
"address": "600003",
"isSelf": true,
"muted": false
}
}