Get Service Level Percentage
Description
Queries aggregate conversation data to retrieve metrics required to calculate Service Level Percentage (SLA %). SLA% is calculated as (nConnected - nOverSla) / nConnected. The absence of a metric means that it has a count of zero.
Business Application
The primary measure of Customer Experience. Indicates the percentage of calls answered within a target threshold (e.g., 80% in 20 seconds). Essential for SLA Compliance monitoring.
Endpoint
POST https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query
Request
Headers
- Authorization: Bearer Token
- Content-Type:
application/json
Body Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
interval |
DateTime | Yes | Time range for this query. Dynamic: Calculate based on current date (e.g., Last 7 Days). |
metrics |
Array | Yes | Array of strings for each requested metric (e.g., ["nOverSla", "nConnected"]) |
Sample Request
{
"interval": "2025-11-09T22:00:00.000Z/2025-11-15T22:00:00.000Z",
"metrics": [
"nOverSla",
"nConnected"
]
}
CURL Example
curl -X POST 'https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query' \
-H 'Authorization: Bearer *******************' \
-H 'Content-Type: application/json' \
--data-raw $'{"interval":"2025-11-09T22:00:00.000Z/2025-11-15T22:00:00.000Z","metrics":["nOverSla","nConnected"]}'
Response
Body Parameters
| Name | Type | Description |
|---|---|---|
results |
Array | Array of results split into groups according to their mediaTypes |
group |
Object | Object containing data for each group |
data |
Object | Object containing data related to the metrics |
Sample Response
{
"results": [
{
"group": {
"mediaType": "message"
},
"data": [
{
"interval": "2025-11-09T22:00:00.000Z/2025-11-15T22:00:00.000Z",
"metrics": [
{
"metric": "nConnected",
"stats": {
"count": 857
}
},
{
"metric": "nOverSla",
"stats": {
"count": 2
}
}
]
}
]
},
{
"group": {
"mediaType": "voice"
},
"data": [
{
"interval": "2025-11-09T22:00:00.000Z/2025-11-15T22:00:00.000Z",
"metrics": [
{
"metric": "nConnected",
"stats": {
"count": 993
}
}
]
}
]
}
]
}