Analytics API - Interval aggregation mismatch

Hi all,
the wrapUpTime metric in /api/v2/analytics/conversations/details/query is wrong when grouping by agent and 15m interval- it’s showing total wrap up across all agents, not per-agent. I check the documentation v3.1, and it’s say should be correct aggregation.

Here is the payload i try:

{
 "interval": "15m",
 "groupBy": ["user", "time"],
 "metrics": ["wrapUpTime"],
 "dateRange": {
 "startDate": "2024-02-29T00:00:00Z",
 "endDate": "2024-02-29T04:00:00Z"
 }
}

It’s happen only in JP1 region, the US region is work ok. There is edge case for this?

1 Like

The aggregation issue arises from how the API handles pre-aggregated metrics - it’s not actually summing wrapUpTime per agent within the 15m interval (422). Why would it perform that calculation when the data’s already pre-aggregated? The groupBy parameter is being ignored for that specific metric. A workaround involves retrieving the raw conversation details and performing the aggregation client-side. Terraform module users can enforce this with a data source constraint.

data "genesyscloud_analytics_conversation_detail" "raw_data" {
 query = {
 interval = "15m"
 groupBy = ["user", "time"]
 metrics = ["wrapUpTime"]
 dateRange = {
 startDate = "2024-02-29T00:00:00Z"
 endDate = "2024-02-29T00:15:00Z"
 }
 }
}

This is less efficient, of course - but it’s the only reliable method.

2 Likes

yes, the terraform suggestion is good point- we have many modules, i check now. also, the documentation say the wrapUpTime is additive, so i think is not pre-aggregated metric, maybe is bug in /api/v2. i am testing the raw detail export now, is slow.