Trying to build a custom report using the Analytics Conversations Aggregates endpoint. I’m hitting /api/v2/analytics/conversations/queries with a POST request from an Azure Function. The goal is to get a rolling 24-hour window broken down into 15-minute intervals.
The docs say I need to use type: "interval" and specify the interval field. Here’s the JSON payload I’m sending:
{
"viewId": "my-custom-view-id",
"dateFrom": "2023-10-27T00:00:00.000Z",
"dateTo": "2023-10-28T00:00:00.000Z",
"interval": "PT15M",
"type": "interval",
"filters": {
"operator": "and",
"predicates": [
{
"type": "equal",
"field": "routing.queue.id",
"value": "queue-id-123"
}
]
}
}
I get a 400 Bad Request. The error body is vague:
{
"code": "bad_request",
"message": "Invalid query parameter",
"status": 400
}
If I change type to "summary" and remove the interval field, it works fine. So the view ID and filters are good. It’s definitely the interval config.
I’ve checked the Swagger spec for POST /api/v2/analytics/conversations/queries. It lists interval as an optional string. The example shows PT1H. I tried PT15M and PT5M. Both fail. Even PT1M fails.
Is there a minimum interval size for this endpoint? Or is PT15M not a valid ISO 8601 duration for this API? The docs don’t list allowed values, just say it’s an ISO 8601 duration.
Also, I’m using the .NET SDK GenesysCloudPlatformSDK.Analytics. The AnalyticsQuery object has an Interval property. I set it to "PT15M". Same error.
Am I missing a required field for interval queries? Or is the type field supposed to be something else? I tried "custom" but that just gives a 400 too.
Any ideas why the interval parameter is being rejected? I’m stuck. The error message doesn’t help. No stack trace. Just “Invalid query parameter”.