Trying to pull real-time queue stats via the CXone OData API. The GET request to /api/v2/analytics/queues/real-time returns a 200 OK, but the entities array is always empty. I’ve verified the date range and query params match the docs exactly.
Checked the auth token and it has the right scope. Any idea why the data isn’t populating? Here’s the basic fetch call I’m using.
1 Like
You’re probably running into the same issue I hit last month. The real-time analytics endpoint is notoriously picky about how you ask for the data. If you don’t explicitly tell it how to group the stats, the API returns an empty array instead of a proper error. It’s a silent failure that really messes you up.
I think the default behavior expects a grouping dimension. For queue stats, you usually want to group by queueId. If you leave that off, the engine doesn’t know how to slice the data, so it gives you nothing. Also, double-check your interval. Real-time data is sampled every 15 seconds. If your start and end times are too far apart, or don’t line up with the sampling window, you might get gaps.
Here’s the working curl command that finally pulled data for me. Notice the groupBy=queueId in the query string. That’s the key.
curl -X GET "https://api.cxone.net/api/v2/analytics/queues/real-time?interval=PT5M&groupBy=queueId&where=queueId IN ('your-queue-id-here')" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"
If you’re using the CXone platform to manage your queue IDs, make sure you’re pulling the actual ID from the configuration, not the name. The queue details in the CXone Admin portal show the ID you need to use.
It’s also worth checking if the queue actually has activity. Real-time stats only show queues with recent interactions. If it’s been quiet for 15 minutes, the entity might just be missing because there’s no data to report. I think trying a test call or chat to the queue and running the request again usually makes it pop up right after the interaction starts.
Also, I’ve seen some issues where the reporting data isn’t immediately available after a queue is created. Give it a few minutes to fully propagate through the system. I’m not sure why that happens, but it’s something to keep in mind.