CXone v2 Reporting API returning empty entities for realtime queue stats

We’ve hit a wall trying to pull real-time queue stats from CXone using the v2 Reporting API. The goal is to update our Android dashboard with current wait times and agent counts every 5 seconds.

The endpoint GET /api/v2/analytics/queue/realtime seems to be the right call based on the docs. We’re passing the since and until timestamps in ISO 8601 format, along with the interval set to PT5S. The authorization header contains a valid OAuth bearer token generated via the client credentials flow.

Here’s the Kotlin code using OkHttp for the request:

val url = "https://${domain}.mypurecloud.com/api/v2/analytics/queue/realtime"
val query = Url.Builder(url)
 .addQueryParameter("since", sinceTimestamp)
 .addQueryParameter("until", untilTimestamp)
 .addQueryParameter("interval", "PT5S")
 .addQueryParameter("aggregates", "average_wait_time,queue_depth")
 .build()

val request = Request.Builder()
 .url(query)
 .header("Authorization", "Bearer $token")
 .header("Accept", "application/json")
 .get()
 .build()

The response comes back with a 200 OK status code. But the JSON payload inside the entities array is always empty. No queue data shows up even though we have agents logged in and calls in the queue right now.

We tried adding divisionId to the query params, but that didn’t change anything. The view parameter was left as default. Is there a specific permission scope missing on the API user? Or maybe the aggregates string format is wrong? We’ve checked the token scopes and analytics:queue:read is definitely included.

The response structure looks like this:

{
 "entities": [],
 "pagination": {
 "total": 0,
 "count": 0
 }
}

Any idea why the data isn’t populating? We’re in the US Central timezone, so maybe there’s a time skew issue with the since parameter? We’re generating the timestamp on the device using System.currentTimeMillis().