Trying to pull agent state history for the last 24 hours via CXone Reporting API v2. The docs say to use the reportDefinition endpoint with an OData filter, but I keep hitting a 400 Bad Request.
Here is the payload I’m sending:
{
"type": "agentStateHistory",
"interval": "PT1H",
"filters": {
"timeRange": {
"start": "2023-10-26T12:00:00Z",
"end": "2023-10-27T12:00:00Z"
}
}
}
- Endpoint:
POST /api/v2/analytics/reportdefinitions - Auth: Bearer token with
analytics:report:readscope - Error response:
{"code": "badRequest", "message": "Invalid filter property 'timeRange'"}
The documentation is vague on the exact JSON structure for agentStateHistory. What am I missing?