Query the hourly granular status code distribution of multiple domain names
パラメータ名 | 説明 |
---|---|
dateFromString | From date:
1.The time format is yyyy-MM-ddTHH:MM:ss+08:00.
2.Cannot exceed current time
3.The most recent six-month (183 days) data are available. |
dateToString | End time:
1.The time format is yyyy-MM-ddTHH:MM:ss+08:00.
2.The end time needs to be greater than the start time. If the end time is greater than the current time, take the current time.
3.If both fields of dataFrom and dateTo are left empty, the default query past 1 day; If there is only one unsent, throw an exception
4.Maximum allowed query time interval: 30 days, Date from and dateTo, not more than 30 days |
domainList | Domain:
1.Allowable maximum number of domain is 20 (can be adjusted by contacting technical support).
2.Automatically filter out illegal domain names (pass illegal domain names, will be filtered out, the query results only return the data of legitimate domain names) |
groupByList | 1.Selection:domain
2.If groupBy left empty, merge date of all domains |
パラメータ名 | 説明 |
---|---|
codeString | |
messageString | |
dataList | |
domainString | Domain. If merge date of all domains will not return domain |
statusCodeDataListList | |
statusCodeString | Status code |
detailListList | |
timestampString | timestamp,Returns the timestamp between the start time and end time.Time format:
Hours: yyyy MM DD hh:00:00 |
valueString | Status code times |
エラーコード(code) | 説明(message) | HTTPステータスコード | 意味 |
---|---|---|---|
24102014 | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | This operation requires a body. Ensure that the body is present and the Content-Type header is set. |
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 minutes. | 400 | You cannot specify a period greater than xx minutes. |
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: groupBy is null or invalid. | 400 | param: groupBy 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/status-code/log" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{ "dateFrom": "2021-11-18T00:00:00+08:00", "dateTo": "2021-11-18T10:00:00+08:00", "domain":["www.test.com"], "groupBy":["domain"] }'
{ "code": "0", "message": "success", "data": [ { "domain": "www.test.com", "statusCodeDataList": [ { "statusCode": "400", "detailList": [ { "timestamp": "2021-11-18 01:00", "value": "10" }, { "timestamp": "2021-11-18 02:00", "value": "20" } ] } ] } ] }