ReportVisitorCustomTopDailyService
パラメータ名 | 説明 |
---|---|
dateFromString | Start time:
The time format is yyyy-MM-dd, for example, 2021-10-10;
It cannot be greater than the current time
You can get data for the last three months (90 days) at most. |
dateToString | End time:
1. The time format is yyyy-MM-dd, the end time must be greater than the start time. If the end time is greater than the current time, the current time is used.
2. If both dateFrom and dateTo are not transmitted, the default query is the past 7 days. If only one is not transmitted, an exception is thrown;
3. The maximum query time interval allowed is 31 days, that is, the difference between dateFrom and dateTo cannot exceed 31 days (you can contact technical support to adjust) |
domainList | Domain name:
1. The upper limit of the number of domain names that can be passed is 100 by default (you can contact technical support to adjust it);
2. Automatically filter out illegal domain names (if an illegal domain name is passed, it will be filtered out, and the query result will only return data for legal domain names);
3. When this parameter is not passed, all domain names under the account will be queried by default, but an error will be prompted when the number of domain names under the account exceeds the upper limit. |
topString | Number of TOPs:
1. If not specified, the default is TOP 10;
2. The maximum number of TOPs is 100. |
orderByString | Sorting:
1. Optional values: request, flow
2. Do not pass the default request |
パラメータ名 | 説明 |
---|---|
codeString | request result status code |
messageString | Request result information |
dataList | Detailed data on the results of the request |
topString | Top |
ipString | IP |
totalFlowString | Total traffic: The unit of measurement is MB, with 2 decimal places. |
totalRequestString | Total requests |
エラーコード(code) | 説明(message) | HTTPステータスコード | 意味 |
---|---|---|---|
24102013 | The accept header specified in your request is not acceptable. | 400 | The accept header specified in your request is not acceptable. |
24102020 | The value of X-Time-Zone header specified in your request in invalid. | 400 | The value of X-Time-Zone header specified in your request in invalid. |
24102002 | There was an error in the body of your HTTP request. | 400 | There was an error in the body of your HTTP request. |
24102006 | The date specified is invalid. | 400 | The date specified is invalid. |
24102007 | You cannot specify a period greater than xx minute(s). | 400 | You cannot specify a period greater than xx minute(s). |
24102019 | The request was rejected because the number of domain(xx) exceeds the limit (xx). | 400 | The request was rejected because the number of domain(xx) exceeds the limit (xx). |
24102008 | param: domain is null or invalid. | 400 | param: domain is null or invalid. |
24102008 | param: orderBy is null or invalid. | 400 | param: orderBy is null or invalid. |
24102008 | param: top is null or invalid. | 400 | param: top is null or invalid. |
24102500 | We encountered an internal error. Please try again. | 500 | We encountered an internal error. Please try again. |
#!/bin/bash
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/visitor/custom-top/daily" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-d '{
"dateFrom": "2021-10-18",
"dateTo": "2021-10-22",
"domain": [
"www.aaaa.com"
],
"orderBy":"flow",
"top":100
}'
{
"code": "0",
"message": "success",
"data": [
{
"top": "1",
"ip": "1.1.1.2",
"totalRequest": "10000",
"totalFlow": "1000.00"
},
{
"top": "2",
"ip": "1.1.1.4",
"totalRequest": "3000",
"totalFlow": "500.00"
},
{
"top": "3",
"ip": "1.1.1.1",
"totalRequest": "1000",
"totalFlow": "100.00"
},
{
"top": "4",
"ip": "1.1.1.3",
"totalRequest": "900",
"totalFlow": "800.00"
}
]
}