Analytics API aggregation query grouping by queue and media type returns empty result

Running into a weird issue with the Analytics API. I’m trying to build a report that aggregates conversation data grouped by both queue and media type. The endpoint is GET /api/v2/analytics/conversations/queues/summary.

I’ve been staring at the docs and my code for an hour. The request goes through fine, no 400s or 500s. But the response body is just {"results": []}. Empty. Every time.

Here’s the JSON payload I’m sending in the body (since it’s a GET with a body, which is… fine, I guess):

{
 "groupings": [
 {
 "type": "attribute",
 "attribute": "queue.id",
 "valueType": "string"
 },
 {
 "type": "attribute",
 "attribute": "mediaType",
 "valueType": "string"
 }
 ],
 "interval": "2023-10-01T00:00:00Z/2023-10-02T00:00:00Z",
 "metrics": [
 "conversationCount",
 "handledCount"
 ]
}

I’ve tried swapping mediaType for media.type and conversation.mediaType. Nothing. I’ve checked the queue IDs. They exist. There was definitely traffic in that window. I even tried removing the grouping by media type, and then I get data for the queues. So the queue grouping works. It’s just the combination that kills it.

Is there a specific syntax for multi-dimensional groupings in this endpoint? The docs show examples with a single grouping, but nothing about stacking them. I feel like I’m missing a subtle flag or a required filter.

Also, just to be sure, I’m using the Python SDK get_analytics_conversations_queues_summary method. It wraps the HTTP call, but I’ve verified the raw request via Postman too. Same result. Empty list.

Anyone seen this before? Feels like a bug, but I doubt it is. bably just me missing something obvious again.

The endpoint doesn’t accept a body. Use query parameters. You’re likely missing the groupBy parameter or the date range.

GET /api/v2/analytics/conversations/queues/summary?groupBy=queue,mediaType&interval=PT1H&from=2023-10-01T00:00:00.000Z&to=2023-10-02T00:00:00.000Z

Check the interval too. Default is often too wide for empty queues.

Query parameters are fine, but if you’re still getting empty results, the date range is bably the culprit. Analytics data isn’t real-time. There’s a lag. If you’re querying from and to dates that are in the last few hours, you’ll get nothing.

Try shifting your window back by at least 24 hours. Also, check if the queues you’re targeting actually had traffic during that specific interval. If a queue is idle, it won’t appear in the summary unless you force it, which the API doesn’t really do for this endpoint.

Here’s a safer curl example using a known busy period:

curl -X GET "https://api.mypurecloud.com/api/v2/analytics/conversations/queues/summary?groupBy=queue,mediaType&interval=P1D&from=2023-09-01T00:00:00.000Z&to=2023-09-02T00:00:00.000Z" \
-H "Authorization: Bearer YOUR_TOKEN"

The analytics engine aggregates in batches. Don’t expect instant gratification. Check the metrics field in the response too. Sometimes it’s not empty, just zeroed out if no metrics were selected.