Hey folks,
I’m trying to pull agent utilization metrics (specifically tHandle, tAcw, and tHold) broken down into 30-minute intervals. The goal is to see how busy agents are throughout the day in finer granularity than the hourly default.
I’m hitting POST /api/v2/analytics/agents/status/query with the following request body:
{
"interval": "PT30M",
"dateFrom": "2023-10-27T00:00:00.000Z",
"dateTo": "2023-10-27T23:59:59.999Z",
"groupBy": ["agent"],
"metrics": ["tHandle", "tAcw", "tHold"]
}
The request returns a 200 OK, but the groupBy section only has agent. The timeGroup is missing from the response entirely, so I’m just getting one big bucket of totals for the whole day. I tried adding "timeGrouping": "PT30M" to the request body, but the API complains that timeGrouping isn’t a valid parameter for this endpoint.
Is there a different endpoint I should be using for time-series data, or am I missing a header? The docs for the agent status query seem to imply it supports time grouping, but I can’t get it to work.
Here’s a snippet of the response I’m getting:
{
"groupBy": {
"agent": [
{
"id": "12345",
"name": "John Doe"
}
]
},
"results": [
{
"groupBy": {
"agent": {
"id": "12345",
"name": "John Doe"
}
},
"metrics": {
"tHandle": { "sum": 1200000 },
"tAcw": { "sum": 300000 },
"tHold": { "sum": 50000 }
}
}
]
}
No time breakdown. Just totals. I’ve tried switching to the real-time agent status view, but that only gives me current state, not historical intervals.
Any ideas on how to force that time grouping?