Following the deprecation of the API "/api/v2/routing/queues/${queueId}/users?joined=true&presence=ON%20QUEUE" I would like to use the following API "/api/v2/analytics/queues/observations/query" to get a count of how many agents are IDLE on queue.
I've used the Query Builder to return the data I want.
Query
{
"filter": {
"type": "or",
"predicates": [
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "6bbb592d-175f-4502-95dc-43db6c2039c1"
}
]
},
"metrics": [
"oUserRoutingStatuses"
]
}
Query Results
{
"results": [
{
"group": {
"queueId": "6bbb592d-175f-4502-95dc-43db6c2039c1"
},
"data": [
{
"metric": "oUserRoutingStatuses",
"qualifier": "INTERACTING",
"stats": {
"count": 1
}
},
{
"metric": "oUserRoutingStatuses",
"qualifier": "IDLE",
"stats": {
"count": 1
}
},
{
"metric": "oUserRoutingStatuses",
"qualifier": "OFF_QUEUE",
"stats": {
"count": 4
}
}
]
}
]
}
Using this information I built a data action with the appropriate configuration and contracts. Please see attached.
Get-Queue-Agents-20210902152736.custom.json (2.2 KB)
Running a test from the data action I get a flattened output for the metrics, qualifiers showing the correct information however for the counts it shows no data. Is this because a list of integers can't be flattered?
If I look at the JSON I see the counts are there.
I tried to use this data action in an Inbound Flow however upon entering the data action it fails straight away.
Am I going about this the right way? I know I could potentially translation map the data to specific contacts but I don't exactly how many results will be returned in the data array each time. Any help would be appreciated?
Thanks,
Darren