The docs state: “The interval field specifies the time bucket size for the aggregated data. Valid values are 1m, 5m, 10m, 15m, 30m, 1h, 1d.” We are hitting a wall with our custom interval report builder. POST to /api/v2/analytics/conversations/aggregates. We are sending a standard payload with a 5-minute interval. The response is a 400 Bad Request. The error message is generic: “Invalid query structure.” Here is the JSON body we are sending:
{
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-01T01:00:00.000Z",
"interval": "5m",
"groupings": ["queue"],
"select": [
{ "name": "conversation/offerCount", "type": "sum" }
],
"filter": [
{ "type": "equals", "path": "queue.id", "value": "8a8b9c7d-1234-5678-90ab-cdef12345678" }
]
}
We have validated the queue ID. It exists. We have checked the timezone. It is UTC. The interval string matches the documentation exactly. We have tried changing the interval to 1m and 1h. Same error. We have removed the filter. Same error. We have removed the select field. Same error. The only thing that works is removing the interval field entirely. But then we get a single data point. We need the granularity. The OAuth token is fresh. It has the analytics:view scope. We are using the Python SDK. The method call is analytics_api.post_conversations_aggregates(body=payload). The exception is genesyscloud.rest.ApiException: (400) Reason: Bad Request. The response body contains no helpful details. Just the generic error. We are stuck. We have tried every variation of the interval string. We have tried adding quotes around the interval value in different ways. Nothing works. The documentation does not mention any hidden requirements for the interval field. We are missing something obvious. Or the API is broken. We have spent two days on this. The next step is to open a support ticket. But we want to know if anyone else has seen this. Is there a bug in the current version of the Analytics API? Or is there a syntax error in our JSON that we are not seeing? We have parsed the JSON with multiple validators. It is valid. The issue must be in the API implementation. Or our understanding of it. We are open to suggestions. Any help is appreciated. We are ready to move on. But we need this data. The report is due tomorrow. We are pulling our hair out. It is a simple request. It should work. It does not. Why?