GetDomainUsage

갱신 시간: 2024-02-07 14:20:52

Get Domainusage, all data of Local Storage is supported in GMT+9

  • 단일 사용자 통화 빈도: 300/5min
  • 해당 상품(제품): Local Storage

요청 파라미터

Body 파라미터

파라미터 이름설명
*dateFrom
Start time 1.The format is yyyy-MM-dd; 2.And smaller than the current time and 'dateTo'; 3.Only the data of the last 2 years can be queried.4.Period between dataFrom and dateTo should not be longer than 31 days
*dateTo
End time 1.The format is yyyy-MM-dd; 2.Must be greater than 'dateFrom'; 3.If it's greater than the current time, then the current time is assigned as the value.
*domain
Domain. Only support send one domain at a time
*contract
contract that the domain belong, only support send one contract at a time
type
Data granularity h: hourly d: daily If not specified, daily is set as the default value

응답 파라미터

Body 파라미터

파라미터 이름설명
domain
Domain
usage
timestamp
DateTime, the format is yyyy-MM-dd HH:mm
usage
Usage,the unit is byte

에러 코드

에러 코드(code)설명(message)HTTP 상태 코드설명
24102006The date specified is invalid.400The date specified is invalid.
24102021Date format error.400Date format error.
24102008param: domain is null or invalid.400param: domain is null or invalid.
24102500We encountered an internal error. Please try again.500We encountered an internal error. Please try again.
24102023Failed to get ids. Please check the domain.400Failed to get ids. Please check the domain.
24102023Invalid parameters. Please check the 'contract' or 'dateFrom' or 'dateTo'.400Invalid parameters. Please check the 'contract' or 'dateFrom' or 'dateTo'.
34102022No contract permission400No contract permission
24102008Domain not found400Domain not found

예제

JSON
JSON
요청 예제
복사 복사 완료
#!/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/domain-usage" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{"dateFrom":"2022-08-01","dateTo":"2022-08-05","domain":"edu.xxx.net","type":"d"}'
응답 예제
복사 복사 완료
{
  "code": "0",
  "message": "success",
  "data": [
    {
      "timestamp": "2022-08-01",
      "usage": "2135"
    },
    {
      "timestamp": "2022-08-02",
      "usage": "2135"
    },
    {
      "timestamp": "2022-08-03",
      "usage": "2141"
    },
    {
      "timestamp": "2022-08-04",
      "usage": "2141"
    },
    {
      "timestamp": "2022-08-05",
      "usage": "2141"
    }
  ]
}
이 문서의 내용이 도움이 되었습니까?
아니오
정상적으로 제출되었습니다.피드백을 주셔서 감사합니다.앞으로도 개선을 위해 노력하겠습니다.