Query ISP Metrics
POST
/ea/isp-metrics/{type}/query
Description
Retrieves ISP metrics data based on specific query parameters. 5-minute interval metrics are available for at least 24 hours, and 1-hour interval metrics are available for at least 30 days.Note: If the UI account lacks access to all requested sites, a 502 error is returned. If partial access is granted, the response will include
status: partialSuccess
.Parameters
type
string
Required
path
Specifies whether metrics are returned using
5m
or 1h
intervalsBody Parameters
sites
array
beginTimestamp
string
date-time
hostId
string
endTimestamp
string
date-time
siteId
string
Example
curl -X POST 'https://api.ui.com/ea/isp-metrics/{type}/query' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY' \
-d '{
"sites": [
{
"beginTimestamp": "2019-08-24T14:15:22Z",
"hostId": "string",
"endTimestamp": "2019-08-24T14:15:22Z",
"siteId": "string"
}
]
}'
Responses
200
ok
data
object
Generic response data, specific schema depends on the endpoint
metrics
array
metricType
string
periods
array
data
object
wan
object
avgLatency
integer
download_kbps
integer
downtime
integer
ispAsn
string
ispName
string
maxLatency
integer
packetLoss
integer
upload_kbps
integer
uptime
integer
metricTime
string
date-time
version
string
hostId
string
siteId
string
message
string
status
string
httpStatusCode
integer
HTTP status code
traceId
string
Request trace identifier
Example Response
{
"data": {
"metrics": [
{
"metricType": "5m",
"periods": [
{
"data": {
"wan": {
"avgLatency": 1,
"download_kbps": 0,
"downtime": 0,
"ispAsn": "12578",
"ispName": "ISP",
"maxLatency": 2,
"packetLoss": 0,
"upload_kbps": 0,
"uptime": 100
}
},
"metricTime": "2024-06-30T13:35:00Z",
"version": "1"
}
],
"hostId": "900A6F00301100000000074A6BA90000000007A3387E0000000063EC9853:123456789",
"siteId": "661900ae6aec8f548d49fd54"
}
]
},
"httpStatusCode": 200,
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
200
partial success
data
object
Generic response data, specific schema depends on the endpoint
metrics
array
metricType
string
periods
array
data
object
wan
object
avgLatency
integer
download_kbps
integer
downtime
integer
ispAsn
string
ispName
string
maxLatency
integer
packetLoss
integer
upload_kbps
integer
uptime
integer
metricTime
string
date-time
version
string
hostId
string
siteId
string
message
string
status
string
httpStatusCode
integer
HTTP status code
traceId
string
Request trace identifier
Example Response
{
"data": {
"metrics": [
{
"metricType": "5m",
"periods": [
{
"data": {
"wan": {
"avgLatency": 1,
"download_kbps": 0,
"downtime": 0,
"ispAsn": "12578",
"ispName": "ISP",
"maxLatency": 2,
"packetLoss": 0,
"upload_kbps": 0,
"uptime": 100
}
},
"metricTime": "2024-06-30T13:35:00Z",
"version": "1"
}
],
"hostId": "900A6F00301100000000074A6BA90000000007A3387E0000000063EC9853:123456789",
"siteId": "661900ae6aec8f548d49fd54"
}
],
"message": "some of the requested sites are not accessible for the user or were ignored as duplicates",
"status": "partialSuccess"
},
"httpStatusCode": 200,
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
400
invalid parameter
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
"code": "parameter_invalid",
"httpStatusCode": 400,
"message": "invalid beginTimestamp format: 2024-06-30",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
401
unauthorized
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
"code": "unauthorized",
"httpStatusCode": 401,
"message": "unauthorized",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
429
rate limit
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Headers
Retry-After
string
example: 5
Example Response
{
"code": "rate_limit",
"httpStatusCode": 429,
"message": "rate limit exceeded, retry after 5.372786998s",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
500
failed to query ISP metrics
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
"code": "server_error",
"httpStatusCode": 500,
"message": "failed to query ISP metrics",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
502
bad gateway
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
"code": "bad_gateway",
"httpStatusCode": 502,
"message": "bad gateway",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}