Getting a 200 OK but the response body is empty when trying to aggregate by queue and media type. Here is the JSON payload I’m sending to the endpoint.
{
"interval": "5 minutes",
"groupBy": ["queueId", "mediaType"],
"metrics": ["offeredCount"]
}
The query runs without error but returns no data rows. Is there a specific format for the groupBy array?
Cause:
The interval value “5 minutes” is invalid for the Genesys Cloud Analytics API. It strictly expects ISO 8601 duration formats. Sending a plain text string causes the query to fail silently or return an empty set because the backend can’t parse the time window correctly. Also, make sure you’re actually querying historical data, not real-time, since this endpoint is for aggregated reports.
Solution:
Switch the interval to PT5M (5 minutes) or P1D (1 day) depending on your needs. You also need to specify the dateFrom and dateTo range explicitly. Here’s a working curl example that actually returns data:
curl -X POST "https://api.mypurecloud.com/api/v2/analytics/conversations/queues/range" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"interval": "PT1H",
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-01T23:59:59.999Z",
"groupBy": ["queueId", "mediaType"],
"metrics": ["offeredCount"]
}'
Check your date range. If no conversations happened in that window, you’ll get an empty array. The groupBy array format you used is fine, just the interval was throwing it off.