This interface is used to query the total number of requests for multiple domain names. Users provide information such as time and domain name, and the interface will return the number of requests in each time segment, supporting data of different granularities (such as data every five minutes, every hour, or every day). This interface helps users monitor website access and follow up and optimize abnormal situations in a timely manner.
| 파라미터 이름 | 설명 |
|---|---|
*dateFromString | Start time 1.The format is yyyy-MM-ddTHH:mm:ss+08:00; 2.And smaller than the current time and dateTo; 3.Period between dataFrom and dateTo should not be longer than 31 days; |
*dateToString | End time 1.The format is yyyy-MM-ddTHH:mm:ss+08:00 2.Must be greater than dateFrom; 3.If it is greater than the current time, then the current time will be assigned as the value; |
typeString | Data granularity 1.fiveminutes: five minutes, hourly: one hour, daily: one day; 2.If not specified, daily is set as the default value; 3.If fiveminutes is specified as the value, then data is returned in the granularity of actual configuration when there is specific configuration of the data collecting granularity for the customer |
| 파라미터 이름 | 설명 |
|---|---|
*domain-listObject | Domain listDomain number limits can be adjusted depending on different accounts. The default value is 1000(if you want to adjust,please, contact technical support) |
domain-nameList | Domain |
| 파라미터 이름 | 설명 |
|---|---|
hit-summaryInteger | Total requests |
hit-dataList | hitData |
timestampString | Date When the querying data granularity is fiveminutes, the format is yyyy-MM-dd HH:mm; the data value of every time slice represents the data value within the previous time granularity range. The first time slice of the day is yyyy-MM-dd 00:05 AM, and the last one is yyyy-MM-dd 24:00;When the data query granularity is hourly, the format is yyyy-MM-dd HH; the data value of every time slice represents the data value within the previous time granularity range. The first time slice of the day is yyyy-MM-dd 00:01, and the last one is yyyy-MM-dd 24;When the querying data granularity is daily, the format is yyyy-MM-dd; the data value of every time slice represents the value of the data;Return the time slices contained in start time and in end time |
hitInteger | Total number of requests, More than 6 digits are displayed in scientific notation,e.g.:1642565=1.642565E6 |
| 에러 코드(code) | 설명(message) | HTTP 상태 코드 | 설명 |
|---|---|---|---|
| DomainNameIsRequired | Requrest body is specified and domain array is empty | 400 | Requrest body is specified and domain array is empty |
| NoSuchDomain | Domain does not exist, or does not belong to the current account that calls the interface | 404 | Domain does not exist, or does not belong to the current account that calls the interface |
| InvalidDatePeriod | datefrom of dateto does not conform to the specification. | 400 | datefrom of dateto does not conform to the specification. |
| DateSpanError | datefrom and dateto should not be more than 31 days apart. | 400 | datefrom and dateto should not be more than 31 days apart. |
| InvalidReportType | Parameter type does not conform to the specification. | 400 | Parameter type does not conform to the specification. |
| DomainsExcessive | The number of domains passed exceeds the account limit. | 403 | The number of domains passed exceeds the account limit. |
| ReportError | System error ( log group interface response error and error code not 200 and 404) (no longer available, to be deleted) | 400 | System error ( log group interface response error and error code not 200 and 404) (no longer available, to be deleted) |
| InternalError | System error | 500 | System error |
#!/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/domainhit?dateFrom=2017-11-06T23:55:00%2B00:00&dateTo=2017-11-07T00:10:00%2B00:00&type=fiveminutes" \ -X "POST" \ -H "X-Time-Zone:GMT+00:00" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/xml" \ -d '<?xml version="1.0" encoding="utf-8"?> <domain-list> <domain-name>test.com</domain-name> <domain-name>test2.com</domain-name> </domain-list> '
<?xml version="1.0" encoding="utf-8"?>
<hit-report>
<hit-summary>129</hit-summary>
<hit-data>
<timestamp>2017-11-06 23:55:00</timestamp>
<hit>20</hit>
</hit-data>
<hit-data>
<timestamp>2017-11-06 24:00:00</timestamp>
<hit>10</hit>
</hit-data>
<hit-data>
<timestamp>2017-11-07 00:05:00</timestamp>
<hit>20</hit>
</hit-data>
<hit-data>
<timestamp>2017-11-07 00:10:00</timestamp>
<hit>30</hit>
</hit-data>
<hit-data>
<timestamp>2017-11-07 00:15:00</timestamp>
<hit>49</hit>
</hit-data>
</hit-report>