QueryExactRuleListByDomain(Access Control)

Update time: 2023-04-28 18:15:59

Query rule list based on domain name(Advanced Access Control)

  • Single user trigger frequency: 300/5min
  • Applicable Products: API Shield,Application Shield,Flood Shield,Bot Shield,Web Application Firewall

Request

Body Params

NameDescription
*serviceTypeString
Service name. WAF:Web Application Firewall BOT:Bot Shield API:API Shield DDoS:DDoS Protection
*domainListList
Related domain.

Response

Body Params

NameDescription
codeString
Status code, success is '200'.
messageString
Return message, success is 'Success'.
dataResp
Data returned
ruleIdString
Rule id.
ruleNameString
Rule Name.
ruleDescriptionString
Rule Description.
actionString
Action. 0:Bypass 1:Block 2:Log
deployContentList
Match Condition.
matchConditionString
Matching condition type. 0:IP 1:IP Segment 2:URI 3:User-Agent 4:Cookie 5:Referer 6:HTTP Header 7:Area 8:HTTP Method 9:Path
operatorString
Matching condition operation. 0:= 1:!= 2:Empty or doesn't exist 3:=(Regex) 4:!=(Regex)
firstConditionString
First Condition.
secondConditionString
Second Condition.

Error code

Error code(code)Description(message)HTTP statusSemantic
22994001CUSTOMER_NOT_EXIST200customer not exist
22995000INTERNAL_ERROR_CODE200internal error
22994000 PARAM_ERROR_CODE200param error
22994100ACCESS_ERROR_NOT_OPEN200The Account is not open service

Example

QUERYEXACTRULELISTBYDOMAIN
QUERYEXACTRULELISTBYDOMAIN
Request example
Copy Copy success
#!/bin/bash
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/bot/exact/query-exact-rulelist-by-domain
-X "POST"  \
-u "$username:$password"  \
-H "Date: $date"   \
-H "Accept: application/json"  \
-H "Content-Type: application/json" \
-d '{
"serviceType":"BOT",
"domainList":["xxx.com"]
}'
Response example
Copy Copy success
{
    "message": "Success",
    "code": "200",
    "data": {
        "totalNum": 13,
        "list": [
            {
                "ruleId": 20619,
                "ruleName": "20230209guoguo3",
                "ruleDescription": "",
                "ruleAction": "0",
                "deployContent": [
                    {
                        "matchCondition": "0",
                        "operator": "0",
                        "firstCondition": [
                            "1.1.1.1",
                            "2.2.2.2",
                            "3.3.3.3"
                        ],
                        "secondCondition": []
                    }
                ]
            }
        ]
    }
}
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!