Having some issues getting my configuration to work…
I am attempting to construct a complex aggregation query via the Genesys Cloud Analytics API to retrieve interaction metrics grouped by both queueId and mediaType. The goal is to feed this data into a Salesforce dashboard via a nightly batch job, ensuring our CRM records reflect real-time queue performance across Voice and Digital channels.
I am using the POST /api/v2/analytics/interactions/queues/query endpoint. Based on the documentation, I believe the groupBy array should accept multiple fields. However, the API consistently returns a 400 Bad Request error. The error message states: Invalid groupBy field: queueId. This is confusing because queueId is explicitly listed as a valid grouping field for queue interaction queries in the schema.
Here is the JSON payload I am sending:
{
"dateRange": {
"startDate": "2023-10-01T00:00:00.000Z",
"endDate": "2023-10-02T00:00:00.000Z"
},
"groupBy": [
"queueId",
"mediaType"
],
"filter": {
"type": "and",
"clauses": [
{
"dimension": "queueId",
"type": "in",
"values": ["queue-uuid-1", "queue-uuid-2"]
}
]
},
"select": [
{
"type": "count",
"dimension": null
}
]
}
I have verified that the OAuth token has the analytics:interaction:view scope. I suspect the issue might be related to how the groupBy fields are ordered or if there is an implicit requirement to include interval when grouping by multiple dimensions.
Is it possible that the Analytics API requires a temporal group-by (like interval) to be present when multiple non-temporal dimensions are specified? Or am I missing a specific syntax requirement for the groupBy array structure?
I need to resolve this urgently as the Salesforce integration depends on this data sync. Any code examples of a valid multi-dimensional group-by query would be greatly appreciated.