Pulled the Genesys Cloud REST SDK v2.1.4 to grab weekly utilization stats for the Virginia BYOC trunks. The /api/v2/analytics/details endpoint’s rejecting the request with a 422 Unprocessable Entity. It’s choking on the date format. Tried ISO 8601, tried epoch milliseconds. Console shows the trunks are registered and routing fine. Logs just dump the same validation error. Don’t know what the parser expects.
“dateRange”: {
“startDate”: “2023-10-01T00:00:00.000Z”,
“endDate”: “2023-10-08T00:00:00.000Z”
}
You need to stick to strict ISO 8601 with the Z suffix for UTC. The parser rejects plain milliseconds or local time offsets.
Spot on, . That Z suffix was exactly what I was missing. I was passing 2023-10-01T00:00:00-05:00 because our ops team is in Eastern time, but the analytics engine is strictly UTC.
Switching to explicit UTC timestamps fixed the 422 immediately. For anyone else hitting this wall with BYOC trunk stats, here’s the working JSON payload structure I used in Postman:
{
"dateRange": {
"startDate": "2023-10-01T00:00:00.000Z",
"endDate": "2023-10-08T00:00:00.000Z"
},
"groupBy": "timeInterval",
"timeInterval": {
"intervalLength": 1,
"intervalUnit": "hour"
},
"view": "byocTrunkUtilization"
}
The groupBy and timeInterval fields are optional but helpful if you want hourly breakdowns instead of a single aggregate number. Just make sure your OAuth token has the analytics:detail:view scope. Took me an hour to realize the SDK wasn’t stripping the timezone offset automatically.