Running a Python script to pull WEM adherence metrics for the last 90 days. The POST to /api/v2/analytics/conversations/summary/queries fails with a 413 Entity Too Large error. The payload size hits the limit because I’m trying to get all agents in one go.
Here is the query body I’m sending:
{
"queryType": "agent",
"interval": "P1D",
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-12-30T23:59:59.999Z",
"groupBy": "agentId",
"metrics": ["adherence"]
}
The response comes back immediately with status 413. I’ve tried reducing the number of metrics but it still fails. The documentation mentions a size limit but doesn’t specify how to chunk the request.
How do I split this into smaller requests? Should I chunk by date range or by agent ID? I need to get the full 90 days for my reporting dashboard.