Hit a wall with the Analytics API today. Trying to pull conversation aggregates for a 90-day window using the Kotlin SDK (genesys-cloud-kotlin). The endpoint is /api/v2/analytics/conversations/aggregates. I’m passing a groupBy of user and a time interval of pt1d. The request body looks standard enough, but the server responds with 413 Entity Too Large immediately.
Here’s the snippet:
val query = AnalyticsQuery(
body = Body(
interval = "2023-10-01T00:00:00.000Z/2023-12-30T23:59:59.999Z",
groupBy = listOf("user"),
pageSize = 1000
)
)
val response = analyticsApi.postAnalyticsConversationsAggregates(query)
The error suggests the payload or the resulting query complexity is too big. I’ve tried reducing the pageSize to 100, which didn’t help. I also tried breaking it down into three 30-day queries, but that feels like a hack. Is there a specific way to paginate or split these queries in the SDK without hitting this limit? The docs mention a max size for the request body, but I’m not seeing a clear way to chunk the date range programmatically without hitting the 413 error. Any ideas on how to structure this?