I’m trying to pull real-time queue metrics for a custom dashboard using the CXone Reporting API. The endpoint is GET /api/v2/analytics/queues/realtime.
I have the OAuth token sorted, and the initial request returns a 200 OK with valid JSON. The payload includes inQueue and waitTime fields, which is exactly what I need. But here’s the issue: the data doesn’t seem to update in real-time. I’m polling every 5 seconds, but the values stay static for several minutes, even though I know agents are wrapping up and new calls are entering the queue.
Here’s a snippet of the response I’m getting:
{
"id": "queue-id-123",
"inQueue": 5,
"waitTime": 120000,
"timestamp": "2023-10-27T14:30:00Z"
}
I’ve tried adding the interval query parameter, but it only seems to affect historical data, not real-time. I’ve also checked the documentation, and it mentions that real-time data is pushed via WebSockets, but I can’t find a clear example of how to subscribe to queue-specific events using the JavaScript SDK.
Is there a specific way to trigger a refresh on the real-time endpoint, or am I missing a WebSocket subscription step? I’ve tried subscribing to presence events, but that doesn’t seem to tie back to queue stats.