Hey everyone,
I’m hitting a wall with the Analytics API. I need to pull interaction data for the last 90 days for a specific queue. When I send the request with a single interval object covering that full range, the API returns a 413 Entity Too Large error. The documentation mentions splitting queries, but it’s not clear on the exact implementation for the Python SDK.
Here is the payload I’m sending:
payload = {
"interval": "2023-10-01T00:00:00.000Z/2023-12-30T23:59:59.999Z",
"view": "interaction",
"groupBy": ["routing.queue.id"],
"select": ["duration"],
"where": [
{
"path": "routing.queue.id",
"operator": "in",
"values": ["queue-id-123"]
}
]
}
The response is just a 413 with no helpful message. I’ve tried reducing the range to 30 days and it works fine. So I assume the issue is the size of the resulting dataset or the query complexity.
Is there a way to split this into multiple requests automatically? Or do I need to manually chunk the interval into smaller blocks (like 7-day chunks) and loop through them? If I do chunk it, do I need to aggregate the results on my side? I want to make sure I’m not missing any interactions at the boundaries.
Also, is there a recommended max duration for a single interval to avoid this error? I’ve seen some posts mention 24 hours but that seems too short for historical reporting.
Any code examples for handling this in Python would be appreciated.