Web Application Firewall

GetTrafficByProtocol

갱신 시간: 2026-07-13 15:49:30

This API is used to query traffic data for multiple domains under a specified transmission protocol, covering data from all edge nodes. Users must specify parameters such as domain, start and end time, and transmission protocol, and can select data granularity and grouping dimensions. By default, the query returns HTTPS protocol traffic data, with output showing traffic values for each domain at different time points. This interface is suitable for scenarios requiring the query and analysis of multi-domain traffic across various transmission protocols.

  • 데이터 지연: 5~15min
  • 단일 사용자 통화 빈도: 300/5min
  • 해당 상품(제품): Content Acceleration,Bot Shield,Dynamic Web Acceleration,Flood Shield,Media Acceleration Live Broadcast,Web Application Firewall,Media Acceleration VoD,Media Acceleration-Live,Flood Shield 2.0
API 인증에 관한 자세한 내용은 다음을 참조하십시오:API 인증 개요

요청 파라미터

Body 파라미터

파라미터 이름설명
dateFromString

Start time: 1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM; 2.Must be no more than 183 days prior to the current time, and must be earlier than both the current time and dateTo. 3.The period between dateFrom and dateTo cannot exceed 7 days (contact technical support for adjustments). 4.Either both dateFrom and dateTo must be specified, or neither should be specified. 5.If neither dateFrom nor dateTo is specified, then by default, data for the last 24 hours is queried.

dateToString

End time: 1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM. 2.Must be greater than dateFrom. 3.If it is greater than the current time, it will be reset to the current time.

*domainList

Domain names. The number of allowed domains can be adjusted based on the account type, with a default limit of 20.

granularityString
기본값: 5m
선택 가능한 값:1m5m1h1d

Data granularity 1m: 1minute 5m: 5minutes 1h: 1hour 1d: 1day

protocolTypeString
기본값: https
선택 가능한 값:httphttps

Transmission protocol: 1.Options: http, https. 2.If no value is specified, https is used as the default. 3.If http is queried, httpFlowData is displayed in the response; if https is queried, httpsFlowData is displayed.

groupByList
선택 가능한 값:domain

Group dimension: 1.Only 'domain' is a valid value. 2.If provided, detailed data will be displayed according to this dimension.

응답 파라미터

Body 파라미터

파라미터 이름설명
resultList

The query result set.

domainString

The domain name.

dataSeriesList

Time-series data list.

timestampString

Timestamp, in yyyy-MM-dd HH:mm format. Each timestamp's data value represents the aggregated data within the preceding time granularity interval. The first timestamp for a day is yyyy-MM-dd 00:05, and the last is (yyyy-MM-dd+1) 00:00.

trafficString

Traffic value: Unit: MB. Retains two decimal places.

에러 코드

에러 코드(code)설명(message)HTTP 상태 코드설명
NotAcceptable

Accept as request header is not   supported, as interface only supports json and xml formats, with json as the   default format

400Accept as request header is not   supported, as interface only supports json and xml formats, with json as the   default format
MissingBody

Request body has not specified

400Request body has not specified
InvalidHTTPRequest

Incorrect format of request body

400Incorrect format of request body
InvalidDatePeriod

dataFrom or dateTo not compliant   to specifications

400dataFrom or dateTo not compliant   to specifications
DateSpanError

Period between dataFrom and   dateTo is longer than 7 days

400Period between dataFrom and   dateTo is longer than 7 days
NumberLimitExceeded

Number of queried domains exceeds   limits set to the account

400Number of queried domains exceeds   limits set to the account
PARAM_INVALID

Parameter groupBy not compliant   to specifications

400Parameter groupBy not compliant   to specifications
InternalError

System has encountered an error

500System has encountered an error
PARAM_INVALID

Parameter domain does not comply with the specification

400Parameter domain does not comply with the specification
PARAM_INVALID

Parameter granularity does not comply with the specification

400Parameter granularity does not comply with the specification
PARAM_INVALID

Parameter protocolType does not comply with the specification

400Parameter protocolType does not comply with the specification

예제

JSON
JSON
요청 예제
복사 복사 완료
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.cdnetworks.com/api/report/traffic/protocol" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
    "dateFrom":"2017-07-05T00:00:00+00:00",
    "dateTo":"2017-07-05T23:00:00+00:00",
    "domain":[
        "test.com"
    ],
    "granularity":"5m",
    "protocolType":"https",
    "groupBy":[
        "domain"
    ]
}'
응답 예제
복사 복사 완료
{
      "result":[
          {
              "domain":"test.com",
              "dataSeries":[
                  {
                      "timestamp":"2017-07-05 00:00",
                      "traffic":"1.20"
                  },
                  {
                       "timestamp":"2017-07-05 00:05",
                       "traffic":"12.37"
                  }
              ]
          }
      ]
  }
이 문서의 내용이 도움이 되었습니까?
아니오
정상적으로 제출되었습니다.피드백을 주셔서 감사합니다.앞으로도 개선을 위해 노력하겠습니다.