Author Message
NarcisC
Joined: Nov 16, 2020
Messages: 44
Offline
Please, do you know what is the best method to identify a VDN for an incoming number via Widget APIs?
skillID?
topicID?
destinationAddress?
mruane
Joined: Jan 26, 2022
Messages: 5
Offline
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
NarcisC
Joined: Nov 16, 2020
Messages: 44
Offline
Hello, Mossy

Thanks a lot.
Do you know if onanyinteraction is present only in latest sdk? (v3.8),
If yes, is there any alternative in version 3.6.0 to get voice interaction data from Home layout?

Regards,
NarcisC
Go to:   
Mobile view