Hey everyone,
I’m trying to build a custom service level report using the Analytics API instead of relying on the out-of-the-box widgets. The goal is to pull raw interval data for a specific queue and calculate the percentage of conversations answered within 20 seconds.
I’m hitting GET /api/v2/analytics/details/queues/summary with a 1-hour granularity. The response gives me buckets for answered, abandoned, and missed, but it doesn’t explicitly give me a “service level” field. I have to derive it.
Here’s the JSON payload structure I’m seeing for a single interval:
{
"granularity": "1h",
"intervals": [
{
"start": "2023-10-27T10:00:00.000Z",
"end": "2023-10-27T11:00:00.000Z",
"metrics": {
"answered": {
"count": 150,
"serviceLevel": 0.85 // Wait, is this cumulative?
},
"abandoned": {
"count": 10
}
}
}
]
}
I see a serviceLevel metric inside the answered object, but I’m not sure if that’s the percentage for that specific hour or a running total. Also, how do I handle the waitTime distribution? The API doesn’t seem to return the exact wait time for each call in this endpoint, just the aggregate counts.
I’m thinking I need to sum up the answered count where waitTime <= 20s and divide by the total answered count. But the interval data doesn’t break down wait times into buckets like “0-20s”, “20-60s”, etc. in this specific endpoint. I’ve checked the conversations/details/query endpoint, but that’s paginated and slow for large datasets.
Is there a better endpoint to get wait time distributions? Or am I supposed to calculate this manually from the serviceLevel metric provided? I’m worried about double-counting if I just sum the hourly percentages.
Any pointers on the correct formula or endpoint? I’m stuck on the math part.