Hey folks,
I’m trying to build a custom SLA report using the Genesys Cloud Analytics API. The dashboard shows one number, but when I pull the raw interval data and crunch it myself, the percentages don’t match up.
I’m hitting /api/v2/analytics/queues/summary with a 30-minute interval. I grab the handledCount and answeringMachineVoicemailCount. Then I filter for intervals where handledCount > 0 and check the sla object for the percentage of calls answered within 20 seconds.
Here’s the rough logic in my Python script:
total_calls = sum(item['metrics']['handledCount'] for item in data['summary'])
calls_within_sla = sum(item['metrics']['sla']['percent'] * item['metrics']['handledCount'] / 100 for item in data['summary'] if item['metrics']['handledCount'] > 0)
# This feels wrong because percent is already an aggregate for that interval?
my_sla = (calls_within_sla / total_calls) * 100
The issue is sla.percent seems to be the percentage of calls in that specific interval that met the target. If I just sum those percentages, it’s nonsense. If I weight them by volume, I’m getting something close, but still off by a few decimal points compared to the UI.
Am I missing a metric like answerSpeed or waitTime that I should be using instead? Or is there a specific weighting formula Genesys uses for the summary SLA that isn’t just a straight volume-weighted average?
I’ve tried looking at the offer counts too, but that just complicates things with abandoned calls.
Any pointers on the exact math here?