QuerySpecificIPBelong

更新時間: 2024-07-29 19:58:51

Query whether an IP belongs to the CDN provider

  • 単一ユーザーの使用頻度: 300/5min
  • 使用できるプロダクト: IP Check

リクエストパラメータ

Body パラメータ

パラメータ名説明
*ipList
IP address, use English comma to separate two items. Every IP address needs to following regular expression rule of ((2[0-4]\\d|25[0-5]|1\\d\\d|0|[1-9]\\d?)\\.){3}(2[0-4]\\d|25[0-5]|1\\d\\d|0|[1-9]\\d?). The default number of IPs cannot exceed 20 (you can contact technical support to adjust) .

レスポンスパラメータ

Body パラメータ

パラメータ名説明
checkListList
checkList
responseString
yes: the IP belongs to Our system, no: the IP does not belong to Our system
ipString
IP addresses

エラーコード

エラーコード(code)説明(message)HTTPステータスコード意味
INVALID_HTTP_REQUESTThere   was an error in the body of your HTTP request.400IP has not been specified
PARAM_TOO_LONGParam   length too long.400Number of queried IP exceeds 20
PARSE_PARAM_ERRORparse param error400IP does not conform to regular expression rules
SYSTEM_ERRORWe encountered an system error. Please try again.500System error

入力例

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/si/tools/ipCheck"   \
  -X "POST" \
-H "X-Time-Zone:GMT+08:00" \
  -u "$username:$password" \
  -H "Date: $date" \
  -H "Accept: application/json" \
 -d '{
      "ip":["1.1.1.1","2.2.2.2"]
  }'
レスポンス例
コピー コピー完了
{
      "result": {
          "checkList": [
              {
                  "response":   "no",
                  "ip":   "1.1.1.1"
              },
              {
                  "response":   "no",
                  "ip":   "2.2.2.2"
              }
          ]
      },
      "code": 200
  }