Quick question about calculating Service Level percentage using raw Analytics API interval data. I am building a Django backend with Celery workers to poll /api/v2/analytics/conversations/aggregate for queue performance metrics. The goal is to compute the Service Level percentage (calls answered within target time / total offered calls) based on the returned interval objects. The JSON payload returns count.answered and count.wait but lacks a direct count.target field. I am currently summing count.answered across intervals and comparing it against a calculated threshold, but the resulting percentage deviates significantly from the Genesys Cloud dashboard. Here is the relevant snippet:
# Pseudo-code logic
for interval in response['interval']:
answered += interval['count']['answered']
# Missing logic for target time filtering
sl = (answered / offered) * 100
The API returns a 200 OK, so the query is valid, but the data granularity seems to aggregate across the entire time bucket rather than filtering by wait time. How do I correctly extract the count of calls answered within the specific target time from the aggregate interval response? The standard REST docs are ambiguous on this specific calculation.