I’m trying to pull historical metrics from the Analytics API, specifically grouping by queue and media type. The endpoint is GET /api/v2/analytics/conversations/details/query.
Here’s the payload I’m sending:
{
"dateRange": {
"startDate": "2023-10-01T00:00:00.000Z",
"endDate": "2023-10-02T00:00:00.000Z"
},
"groupings": [
{
"groupBy": "queue",
"subGroupBy": "mediaType"
}
],
"metrics": [
"totalHandled",
"totalAbandoned"
]
}
The request comes back with a 400 Bad Request. The error message is vague: Invalid grouping configuration. I’ve checked the Swagger docs, and queue and mediaType are listed as valid group-by values for conversation details.
I’ve tried swapping the order of the groupings, but it makes no difference. I’ve also tried using the filter parameter to isolate a single queue, but the same error persists.
Is there a known limitation on nested groupings in the v2 analytics API? Or am I missing a required field in the grouping object? I’m using the Python SDK, but the raw HTTP call fails too, so I don’t think it’s an SDK issue.