Request URL: domain/config (GET)
Endpoint Domain Name:
cdn.api.baishan.com
Endpoint Version:v2
Use this API to view configurations for individual hostnames, including features like caching rules, origin setting, IP blacklist, referer white- and blacklist.
Note: Each user account can make up to 30 calls/minute for this API. The API endpoint is only meant for non- live-streaming configurations.
Notice: Please request the API token from your account team.
Add request parameters to the URL query strings, i.e. ?key1=value1&key2=value2.
Parameter | Data Type | Requirement | Description |
---|---|---|---|
Domain | String | Required | Domain names. Separate domain names by commas (,). Up to 10 domain names at a time. For example, aa.qingcdn.com,bb.qingcdn.com. |
config | array | Required | Specify the config rule(s) that you’d like to look up. The default is to return all config rules. For example:["referer","origin","ip_black_list","cache_rule","origin_host"] |
Sample 1:
curl -X GET 'https://cdn.api.baishan.com/v2/domain/config?token=token&domains=www.test.com&config[]=referer&config[]=origin' -g
Sample 2:
curl -X GET "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '
{
"config": [
"origin",
"referer",
"cache_rule"
],
"token": "token",
"domains": "aa.qingcdn.com,bb.qingcdn.com"
}'
Json format.
{
"code": 0, //0 means success. When a lookup request succeeds, the requested configs will be returned.
"data": [
{
"domain": "www.test.com", //domain name
"domain_id": "25419", //domain ID
"config": {
"referer": { //referer-based blacklist and whitelist
"allow_empty": true, //true/false: allow/block empty refer
"type": 1, // Config type: 1. Whitelist 2. Blacklist
"list": [ //refer list
"*.aaa.test.com",
"www.test.com"
]
},
}
},
...
]
}
HTTP/1.0 200 OK
Api-Id: 814
Content-Type: application/json; charset=utf-8
X-Ratelimit-Grad: minute //Endpoint rate limit granularity (minute/hour/day).
X-Ratelimit-Limit: 30 //Maximum number of calls per minute.
X-Ratelimit-Remaining: 29 //Number of calls left in this minute.
X-Retry-After: 58 //Reset the call number count in xx seconds.
Error Code | Description |
---|---|
404 | Bad request URLs. |
401 | Authorization Error: Invalid token or lack of access. |
400 | Bad request parameters. |
200 | Success. |
5xx | Please contact your account team. |