Development Document

View Configuration Download PDF Document

Endpoint

Request URL: domain/config (GET)

Endpoint Domain Name: cdn.api.baishan.com
Endpoint Version: v2

Endpoint Description

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.

API Parameters

Notice: Please request the API token from your account team.

Request Parameters (GET)

Add request parameters to the URL query strings, i.e. ?key1=value1&key2=value2.

ParameterData TypeRequirementDescription
DomainStringRequiredDomain names. Separate domain names by commas (,). Up to 10 domain names at a time. For example, aa.qingcdn.com,bb.qingcdn.com.
configarrayRequiredSpecify 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 Request:

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"
}'

Sample Response

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"
                    ]
                },
            }
        },
        ...
    ]
}

Response Header

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.

HTTP Status Codes

Error CodeDescription
404Bad request URLs.
401Authorization Error: Invalid token or lack of access.
400Bad request parameters.
200Success.
5xxPlease contact your account team.
CopyRight © 2015-2022 BaishanCloud . All Rights Reserved.