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. I’m using the async aggregates query flow, submitting a job and then fetching the results via GET /api/v2/analytics/conversations/aggregates/jobs/{jobId}/results.
I’ve been staring at the docs and my code for an hour. The job completes successfully, no 400s or 500s. But the response body is just {"results": []}. Empty. Every time.
Here’s the JSON payload I’m sending in the request body to initiate the job:
{
"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 to submit the job and fetch the results. 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. Probably just me missing something obvious again.