Skip to main content

Get Customer Bandwidth

This API is used to retrieve customer bandwidth data, aggregated in 5-minute or 1-day intervals.

Request​

Request-Line​

POST /cdn/v1.0/analytics/getBandwidthByCustomerId HTTP/1.1

Request Parameters​

Body Parameters​

ParameterTypeRequiredDescription
startTimeStringMandatoryStart time. Format varies by interval:
• If the interval is minute, use yyyy-MM-ddTHH:mm:ssZ (e.g., 2024-01-15T14:30:00Z).
• If interval is day, use yyyy-MM-ddT00:00:00Z (e.g., 2024-01-15T00:00:00Z).
endTimeStringMandatoryEnd time. Format varies by interval:
• If the interval is minute, use yyyy-MM-ddTHH:mm:ssZ (e.g., 2024-01-15T14:30:00Z).
• If interval is day, use yyyy-MM-ddT00:00:00Z (e.g., 2024-01-15T00:00:00Z).
intervalStringOptionalGranularity of data points. Supported values:
• minute (default) - Each data point represents 5 minutes. Time range cannot exceed 24 hours.
• day - Each data point represents one day. Time range cannot exceed 90 days.

Response​

Response Body​

ParameterTypeDescription
ArrayArray of Service Bandwidth object.
Object: Service Bandwidth​
ParameterTypeDescription
timestampStringTimestamp in UTC, using the format yyyy-MM-ddTHH:mm:ssZ.
valueFloatBandwidth value in bps (e.g., 94.33).

Status Codes, Error Codes and Error Messages​

Status CodeError CodeError Message
400CustomerId.InvalidCustomer ID is empty or invalid.
400IntervalType.InvalidInterval type must be minute or day.
400Time.InvalidStartTime or EndTime is required.
400DayIntervalTimeFormat.InvalidStartTime or EndTime must use the format yyyy-MM-ddT00:00:00Z.
400MinuteIntervalTimeFormat.InvalidStartTime or EndTime must use the format yyyy-MM-ddTHH:mm:ssZ.
400TimeRange.ExceededWhen interval is day, the time range between StartTime and EndTime cannot exceed 90 days.
400TimeRange.ExceededWhen interval is minute, the time range between StartTime and EndTime cannot exceed 24 hours.
400TimeRange.EndBeforeStartEndTime must be later than StartTime.
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.

Examples​

Get Customer Bandwidth​

Request​

POST /cdn/v1.0/analytics/bandwidth HTTP/1.1

{
"startTime": "2025-11-06T00:00:00Z",
"endTime": "2025-11-08T00:00:00Z",
"interval": "day"
}

Successful Response Body​

[
{
"timestamp": "2025-11-06T00:00:00Z",
"value": 1629855211515.04
},
{
"timestamp": "2025-11-07T00:00:00Z",
"value": 1595099605379.88
}
]