This interface is used to query the number of independent IP addresses for each stream name within a single domain name. The user provides a specific domain name and time to obtain information about the specified stream during this period (in days). The results returned by the interface include statistics on independent IP addresses for the domain name and its corresponding stream name. This helps users understand the distribution of visitors to each stream, thereby optimizing traffic configuration or evaluating the use of streaming media services.
파라미터 이름 | 설명 |
---|---|
*dateFromString | Start time
1. The format is yyyy-MM-ddTHH:mm:ss+08:00;
2. Must be smaller than the current time and dateTo;
3. Period between dataFrom and dateTo cannot be longer than 3 days(technical support can be contacted to adjust);
4. You can only query data for the last 2 years. |
*dateToString | End time
1. The format is yyyy-MM-ddTHH:mm:ss+08:00;
2. Must be greater than dateFrom;
3. The query range must include 00:00:00 of a certain day to query the data of that day. For example, if the query range includes 2017-11-07 00:00:00, the data of 2017-11-07 can be queried. |
파라미터 이름 | 설명 |
---|---|
*domainString | Domain, maximum number is 1 |
streamString | Stream name:
1. Limit to the number of streams can be adjusted depending on different accounts. The default value is 20;
2. All streams are queried by default is this field is left empty and at the same time, the upper limit of the number of streams can be set. |
파라미터 이름 | 설명 |
---|---|
resultList | |
domainString | Domain |
detailsList | |
streamString | Stream name |
timestampString | Time, format is yyyy-MM-dd |
totalInteger | Number of unique IP addresses |
에러 코드(code) | 설명(message) | HTTP 상태 코드 | 설명 |
---|---|---|---|
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept as request header is not supported, as interface only supports json format |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | Incorrect format of request body |
DateSpanError | You cannot specify a period greater than 3. | 400 | Period between datafrom and dateto is longer than 3 days |
InvalidDatePeriod | The date specified is invalid. | 400 | datafrom or dateto not compliant to specifications |
DomainsExcessive | The number of domain is excessive once. | 403 | Number of domains exceeds the set limit |
StreamsExcessive | The number of stream is excessive once. | 403 | Number of streams exceeds the set limit |
PARAM_INVALID | param: stream is null or invalid. | 400 | Parameter of stream not compliant to specifications |
NoSuchDomain | The specified domain does not exist. | 404 | Domain does not exist, or does not belong to the current account that calls the interface |
InternalError | We encountered an internal error. Please try again. | 500 | System has encountered an 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/visitor/total/stream?datefrom=2017-11-01T00:00:00%2B08:00&dateto=2017-11-02T00:00:00%2B08:00" \
-X "POST" \
-H "X-Time-Zone:GMT+08:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '[
{
"domain":"test.com",
"stream":[
"test.com/abc/steam01"
]
}
]'
{
"result":[
{
"domain":"test.com",
"details":[
{
"stream":"test.com/abc/steam01",
"timestamp":"2017-11-01",
"total":11
},
{
"stream":"test.com/abc/steam01",
"timestamp":"2017-11-02",
"total":22
}
]
}
]
}