I'm trying to create a quick demo of Web Callbacks. This is all executed client-side, I don't have a NodeJS server relaying the requests, like the Tutorial. Here is my code:
function createCallback() {
var session = purecloud.platform.PureCloudSession({
strategy: 'token',
token: 'my token'
});
session.login().then(function() {
var callbackData = {
"routingData": {
"queueId": "cc4b3399-4b27-45b3-9e31-1ff773ce5a1f"
},
"scriptId": "2f0762d0-a4c3-11e6-a1d5-4377309bca4f",
"callbackUserName": "Tutorial Callback",
"callbackNumbers": [
"3172222222"
],
"data":{
"customDataAttribute": "custom value"
}
}
var conversationApi = new purecloud.platform.ConversationsApi(session);
conversationApi.postCallbacks(callbackData).then(function(callbackResponseData) {
console.log("Callback Created");
console.log(callbackResponseData);
})
.catch(function(error) {
console.log(error);
});
});
It seems to work somewhat, because the Callback is created (twice), and is sent to the correct queue, however the ACD never picks up to assign to a user.
Here are the interaction details while in queue:
{
"id": "6b2e12df-9c09-493e-b595-0f56b476e38b",
"participants": [
{
"id": "0bca0667-3e26-4062-a027-3da269afa2c3",
"name": "Tutorial Callback",
"startTime": "2017-01-12T21:01:52.960Z",
"connectedTime": "2017-01-12T21:01:53.045Z",
"purpose": "customer",
"state": "connected",
"held": false,
"wrapupRequired": false,
"queue": {
"id": "cc4b3399-4b27-45b3-9e31-1ff773ce5a1f",
"selfUri": "/api/v2/routing/queues/cc4b3399-4b27-45b3-9e31-1ff773ce5a1f"
},
"attributes": {
"customDataAttribute": "custom value"
},
"script": {
"id": "2f0762d0-a4c3-11e6-a1d5-4377309bca4f",
"selfUri": "/api/v2/scripts/2f0762d0-a4c3-11e6-a1d5-4377309bca4f"
},
"provider": "PureCloud Callback",
"callbackNumbers": [
"+13172222222"
],
"callbackUserName": "Tutorial Callback",
"skipEnabled": true,
"timeoutSeconds": 0
},
{
"id": "85eeb718-2a68-4009-a112-e041693ff5b1",
"startTime": "2017-01-12T21:01:52.962Z",
"connectedTime": "2017-01-12T21:01:53.184Z",
"purpose": "acd",
"state": "connected",
"held": false,
"wrapupRequired": false,
"queue": {
"id": "cc4b3399-4b27-45b3-9e31-1ff773ce5a1f",
"selfUri": "/api/v2/routing/queues/cc4b3399-4b27-45b3-9e31-1ff773ce5a1f"
},
"attributes": {
"customDataAttribute": "custom value"
},
"script": {
"id": "2f0762d0-a4c3-11e6-a1d5-4377309bca4f",
"selfUri": "/api/v2/scripts/2f0762d0-a4c3-11e6-a1d5-4377309bca4f"
},
"provider": "PureCloud Callback",
"callbackNumbers": [
"+13172222222"
],
"callbackUserName": "Tutorial Callback",
"skipEnabled": true,
"timeoutSeconds": 0
}
],
"otherMediaUris": [],
"selfUri": "/api/v2/conversations/callbacks/6b2e12df-9c09-493e-b595-0f56b476e38b"
}
Any ideas?
--Lehel