This interface is used to count the number of URL requests and traffic of a domain name within each hour, and generate a ranking list of up to TOP500. Users need to provide the time return and domain name to obtain the total number of URL requests, total traffic, number of hit requests, number of failed requests, and details of different status codes. The interface supports sorting by total number of requests or total traffic to quickly identify high-frequency access or high-traffic URLs. This interface helps users monitor URL access frequency and traffic to adjust corresponding network policies.
| 파라미터 이름 | 설명 |
|---|---|
dateFromString | Start date:
|
dateToString | End time:
|
domainList | Domain name:
|
orderByString | Ordering:
|
| 파라미터 이름 | 설명 |
|---|---|
topString | Top ranking |
urlString | url |
totalFlowString | Total flow: unit of measure MB, keeping 2 decimal places |
totalRequestString | Total request |
hitRequestString | Total hit request |
missRequestString | Total miss request |
sc200String | Number of requests for status code 200 |
sc206String | Number of requests for status code 206 |
sc302String | Number of requests for status code 302 |
sc304String | Number of requests for status code 304 |
sc404String | Number of requests for status code 404 |
| 에러 코드(code) | 설명(message) | HTTP 상태 코드 | 설명 |
|---|---|---|---|
| NotAcceptable | Accept request header not supported, interface supports json and xml format only, default is json format | 400 | Accept request header not supported, interface supports json and xml format only, default is json format |
| InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | There was an error in the body of your HTTP request. |
| InternalError | We encountered an internal error. Please try again. | 500 | We encountered an internal error. Please try again. |
| InvalidDatePeriod | The date specified is invalid. | 400 | The date specified is invalid. |
| PARAM_INVALID | param: domain is null or invalid | 400 | param: domain is null or invalid |
| NumberLimitExceeded | The request was rejected because the number of domain(6) exceeds the limit (5). | 400 | The request was rejected because the number of domain(6) exceeds the limit (5). |
| DateSpanError | You cannot specify a period greater than 31 day(s). | 400 | You cannot specify a period greater than 31 day(s). |
| PARAM_INVALID | param: orderBy is null or invalid. | 400 | param: orderBy is null or invalid. |
#!/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/url/top" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{"dateFrom": "2019-01-01T10:00:00+00:00","dateTo": "2019-01-02T10:00:00+00:00","domain": ["www.aaa.com","www.bbb.com"],"orderBy": "totalRequest"
}'{
"result":[
{
"top":"1",
"url":"http://www.aaa.com/ccdrg13.image",
"totalRequest":"37947",
"totalFlow":"954624377.23",
"hitRequest":"35269",
"missRequest":"2678",
"sc200":"21331",
"sc206":"1",
"sc302":"0",
"sc304":"146",
"sc404":"0"
},
{
"top":"2",
"url":"http://www.aaa.com/css/common.jpg",
"totalRequest":"12506",
"totalFlow":"93871265",
"hitRequest":"11766",
"missRequest":"740",
"sc200":"34553",
"sc206":"13",
"sc302":"2",
"sc304":"0",
"sc404":"3"
},
{
"top":"100",
"url":"http://www.bbb.com/css/style.css",
"totalRequest":"2765",
"totalFlow":"12721647",
"hitRequest":"2467",
"missRequest":"298",
"sc200":"443241",
"sc206":"7",
"sc302":"0",
"sc304":"0",
"sc404":"0"
}
]
}