I’m trying to build a dashboard widget that shows conversation volume grouped by queue and media type. I’m using the POST /api/v2/analytics/conversations/details/queries endpoint. The request seems valid but the response data array is always empty. I’ve checked the time range and it’s definitely within the last 24 hours.
Here is the query body I’m sending:
{
"timeRange": {
"from": "2023-10-25T00:00:00.000Z",
"to": "2023-10-25T23:59:59.999Z"
},
"groupBy": ["queue.id", "mediaType"],
"aggregates": [
{
"name": "count",
"type": "count"
}
]
}
The API returns a 200 OK status. No errors in the response. Just an empty data list. I’m using the client credentials grant for authentication. The token has the analytics:query:view scope. I’ve also tried analytics:conversations:view. Same result.
Is the groupBy syntax correct for multiple dimensions? I see examples in the docs that only group by one field. When I remove mediaType and just group by queue.id, I get data. Adding the second dimension breaks it. I’ve tried changing the order. Doesn’t help.
Maybe the aggregate type is wrong for this grouping? I need a simple count of conversations. The documentation isn’t super clear on multi-dimensional grouping limits.