/api/v2/analytics/conversations/aggregates/query

I am a novice in running these APIs, but our Bi team is buiding us a Contact center dashboard. I am in the early stages of testing these APIs. I am attempting to run /api/v2/analytics/conversations/aggregates/query to get the count of answed calls/offered calls. When I run this API with limited filters, my numbers simply arent matching our workspace numbers. Can someone help me understand what I am missing?

"interval": "2023-01-02T00:00:00/2023-01-03T00:00:00",
"filter": {
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "4d47de82-b5a2-4265-9be2-494e5d327697"
}
]
},
"metrics": [
"nOffered",
"nConnected"
]
}

results show only 66 connected calls out of 309 offered for that queue. When I pull the same numbers in Workspace, 313 ansered and 326 offered

tAnswered count is the metric you're looking for to match the raw metric used for answer counts in the performance views. The other reason you're off is likely because you're not doing any sort of time zone adjustments. The interval you defined in your query is querying for Jan 2nd with no GMT offset adjustment at all. The UI would specify an interval like "2023-01-02T06:00:00.000Z/2023-01-03T06:00:00.000Z" to offset for the central time zone. You'll want to do something similar to match whatever timezone you are in when comparing with the performance views.

My numbers dont match exactly to the workspace. They are close, but a few off. What could be the discrepancy?

My advice would be to load developer tools in your browser and pull the query the UI is running from the network tab in the console logs. That will show you the exact API request the UI is using which you can compare against your own to look for differences. If that still doesn't get you there, I'd recommend you open a support ticket. The investigation from this point would require looking at your actual data to compare why your results are different.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.