Trying to calculate Service Level percentages using the raw interval data from the Analytics API instead of relying on the pre-calculated metrics in the UI. We need this for a custom dashboard that aggregates across multiple queues.
I’m hitting GET /api/v2/analytics/interactions/summary with granularity=INTERVAL and intervalSize=5m. The response returns a list of intervals, each containing answerLevel and targetAnswerLevel objects.
Here’s the JSON structure I’m getting for a single interval:
{
"interval": "2023-10-27T10:00:00.000Z",
"answerLevel": {
"0": 5,
"10": 12,
"20": 30,
"30": 45
},
"targetAnswerLevel": {
"0": 10,
"10": 25,
"20": 40,
"30": 50
}
}
My logic is to sum the answerLevel values where the time is less than or equal to the target (e.g., 20 seconds) and divide by the total offered calls. But I’m not sure where to get the total offered calls from this endpoint. The answerLevel sums to 92, but the UI shows 150 offered calls for that interval.
I tried summing the targetAnswerLevel values, but that gives 125, which is still off. Is there a field I’m missing that represents the total volume? Or is the answerLevel object cumulative in a way I’m not accounting for?
I’ve checked the developer docs, but they just say “number of interactions answered within the specified time”. They don’t explain how to derive the denominator.
Also, when I filter by queue.id, the answerLevel keys sometimes skip values (e.g., jumps from 10 to 30). Does that mean zero calls were answered in that bucket, or is the data sparse?
Running this in Python with requests. Any idea how to map this to a standard SL% formula?