Hi,
i'm trying to create a data action that will return the number of 'on queue' users in a queue i have the below (unfortunately new users can't upload files so putting the code here) but it always sends back 0 as people in queue even when i'm set to that status
{
"name": "Get_Users_in_queue_Ver 3 - Exported 2018-07-25 @ 8:31 - Exported 2018-07-25 @ 8:05",
"integrationType": "purecloud-data-actions",
"actionType": "custom",
"config": {
"request": {
"requestUrlTemplate": "/api/v2/analytics/queues/observations/query",
"requestType": "POST",
"headers": {},
"requestTemplate": "{"filter": {"type":"or","predicates": [{"dimension": "queueId","value": "${input.QUEUE_ID}"}]}}"
},
"response": {
"translationMap": {
"metrics": "$.results[0].data[?(@.metric=="oOnQueueUsers")].stats.count"
},
"successTemplate": "{"metrics": ${successTemplateUtils.firstFromArray("${metrics}", "0")}}"
}
},
"contract": {
"input": {
"inputSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Active agents in Queue",
"description": "The number of agents in a queue.",
"type": "object",
"required": [
"QUEUE_ID"
],
"properties": {
"QUEUE_ID": {
"description": "The queue ID.",
"type": "string"
}
}
}
},
"output": {
"successSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metrics": {
"type": "integer"
}
}
}
}
},
"secure": false
}
any help appreciated
Kind Regards,
Ian