Hi @NarcisC,
Sure. Information such as skillID, topicID and destinationAddress would be available on the interaction object itself.
So subscribing to the onInteractionEvent would return a data object containing these properties.
This will work if the widget is sitting in an interaction layout, and the api has been passed an interaction ID on api init.
Otherwise, if the widget is on a home layout, and the api is not associated with a specific interaction, the onAnyInteractionEvent will return the same information, firing any time any interaction is created or updated.
Examples:
//Interaction specific
const interactionId = this.getAttribute('interactionid')
const api = (<any>window).WS.widgetAPI(interactionId);
api.onDataEvent('onInteractionEvent', function (data) {
// do something with the event data
console.log(data);
});
//Not interaction specific:
const api = (<any>window).WS.widgetAPI();
api.onDataEvent('onAnyInteractionEvent', function (data) {
scope.currentState = data.state;
});
Sample 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"
}
Thanks,
Mossy
|