QuerySpecificIPBelong

Update time: 2024-07-29 19:58:51

Query whether an IP belongs to the CDN provider

  • Single user trigger frequency: 300/5min
  • Applicable Products: IP Check

Request

Body Params

NameDescription
*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) .

Response

Body Params

NameDescription
checkListList
checkList
responseString
yes: the IP belongs to Our system, no: the IP does not belong to Our system
ipString
IP addresses

Error code

Error code(code)Description(message)HTTP statusSemantic
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

Example

JSON
JSON
Request example
Copy Copy success
#!/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"]
  }'
Response example
Copy Copy success
{
      "result": {
          "checkList": [
              {
                  "response":   "no",
                  "ip":   "1.1.1.1"
              },
              {
                  "response":   "no",
                  "ip":   "2.2.2.2"
              }
          ]
      },
      "code": 200
  }
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!