universal
This interface is used to count the edge status code data of multiple domain names. Users can select the query time range and domain name list to obtain data. The returned content includes the status code distribution of each domain name and its corresponding number of requests. It helps users analyze the domain name access status and optimize content distribution strategies.
Single user trigger frequency: 300/5min
| Name | Description |
|---|---|
*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 a time that is 183 days earlier than the current time, and the time must be earlier than the current time and dateTo;
3.Period between dataFrom and dateTo cannot be longer than 7 days(technical support can be contacted to adjust);
4.dateFrom and dateTo can be either both are specified or neither is specifies;
5.If neither dateFrom nor dateTo is specified, then by default, data in the last 24 hour 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; if it's greater than the current time, then the current time is assigned as the value; |
*domainList | Domain names:
1.Domain number limits can be adjusted depending on different accounts. The default value is 20
2.Query all domain names under account when this entry is not passed |
*dataIntervalString | Data granularity, 5m: granularity of 5 minutes |
*groupByList | Group dimension
1.The value can be selected is domain;
2.The data is displayed according to the specified dimension; |
*dataPaddingBoolean | 1.If 0 is added, the value is true or false, which is false by default
2.When the value of data adding is true, data is added to time points without data
3.When the dataPadding value is false, no treatment will be done |
*queryByString | Query dimension. Optional values: statusCode, statusCodeType. Default value is statuscode.
1.statusCode: returns the status code details;
2.statusCodeType: returns the requests of eachstatus code type (such as the number of requests corresponding to success, redirect, not modified, permission, not found, server error, and other) |
| Name | Description |
|---|---|
resultList | result |
domainString | Domain |
statusCodeDataList | statusCodeData |
statusCodeString | Status code |
totalRequestString | totalRequest |
statusCodeTypeString | Success, Redirect, Not-Modified, Permission, Not-Found, Server Error, Other |
requestDataList | requestData |
timestampString | DateTime, 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. |
valueString | Number of requests for status codes |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| MissingBody | Request body has not specified | 400 | Request body has not specified |
| NotAcceptable | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format | 400 | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format |
| InvalidHTTPRequest | Incorrect format of request body | 400 | Incorrect format of request body |
| InvalidDatePeriod | dataFrom or dateTo not compliant to specifications | 400 | dataFrom or dateTo not compliant to specifications |
| DateSpanError | Period between dataFrom and dateTo is longer than 7 days | 400 | Period between dataFrom and dateTo is longer than 7 days |
| PARAM_INVALID | Parameter groupBy not compliant to specifications | 400 | Parameter groupBy not compliant to specifications |
| NumberLimitExceeded | Number of specified domains exceed upper limit | 400 | Number of specified domains exceed upper limit |
| InternalError | System has encountered an error | 500 | System has encountered an error |
| PARAM_INVALID | param: domain is null or invalid. | 400 | param: domain is null or invalid. |
| PARAM_INVALID | param: dataInterval is null or invalid. | 400 | param: dataInterval is null or invalid. |
| PARAM_INVALID | param: dataPadding is null or invalid. | 400 | param: dataPadding 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.atomile.com/api/report/status-code" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{"dateFrom": "2019-01-01T23:55:00+00:00","dateTo": "2019-01-02T00:10:00+00:00","domain": ["www.111.com","www.222.com"],"dataInterval": "5m","groupBy": ["domain"],"dataPadding":true,"queryBy":"statusCode"
}'{
"result":[
{
"domain":"www.111.com",
"statusCodeData":[
{
"statusCode":"200",
"totalRequest":"1332",
"requestData":[
{
"timestamp":"2019-01-01 00:05",
"value":"844"
},
{
"timestamp":"2019-01-02 00:00",
"value":"0"
},
{
"timestamp":"2019-01-02 00:05",
"value":"10"
},
{
"timestamp":"2019-01-02 00:10",
"value":"200"
}
]
},
{
"statusCode":"400",
"totalRequest":"1332",
"requestData":[
{
"timestamp":"2019-01-01 00:05",
"value":"641"
},
{
"timestamp":"2019-01-02 00:00",
"value":"0"
},
{
"timestamp":"2019-01-02 00:05",
"value":"140"
},
{
"timestamp":"2019-01-02 00:10",
"value":"200"
}
]
}
]
},
{
"domain":"www.222.com",
"statusCodeData":[
{
"statusCode":"200",
"totalRequest":"1332",
"requestData":[
{
"timestamp":"2019-01-01 00:05",
"value":"785"
},
{
"timestamp":"2019-01-02 00:00",
"value":"0"
},
{
"timestamp":"2019-01-02 00:05",
"value":"230"
},
{
"timestamp":"2019-01-02 00:10",
"value":"200"
}
]
}
]
}
]
}