I am currently considering a data action that counts the number of waiting calls in multiple queues.
If it is a single queue, I can achieve this with the following structure, but for example, if I set the argument to 4, and I want to count the total number of calls waiting in a maximum of 4 queues, I don't know how to do it.
If I want to count with 4 arguments, how should I do it for the contract, request body template, and response mapping?
(CONTRACT)
Input
Title: input (object type)
Title: queueId (string type)
Output
Title: results.data.stats (object type)
Title: WaitingCalls (number type)
(Action settings)
HTTP Method: POST
Request URL Template: /api/v2/analytics/queues/observations/query
Request body template:
{
"filter": {
"type": "or",
"predicates": [
{
"dimension": "queueId",
"value": "${input.queueId}"
},
{
"dimension": "mediaType",
"value": "voice"
}
]
},
"metrics": ["oWaiting"]
}
}
Response Mapping:
{
"translationMap": {
"WaitingCalls": "results[0].data[0].stats.count"
},.
"translationMapDefaults": {
"WaitingCalls": "0"
},.
"successTemplate": '{ 'WaitingCalls": ${WaitingCalls} }"
}
Best regards,