Development Document

Purge Status Download PDF Document

Endpoint

Request URL: cache/refresh (GET)

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

Endpoint Description

Use this API to look up your purge request statuses. See details on the request rate limit in the Response Header section below.

Notice: Historical purge statuses will only be kept for a month. Please make sure to track or record the statuses within the timeline.: Historical purge statuses will only be kept for a month. Please make sure to track or record the statuses within the timeline.

API Parameters

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

Request Parameters (GET)

The parameters should be added to the query string portion of an URL, for instance: ?key1=value1&key2=value2.

ParameterData TypeRequirementDescription
start_timestringRequiredMethod 1: Start_time, for example: 2018-02-11. [star_time,end_time,url] parameters should be used together in this format and can’t be used with task_id.
end_timestringRequiredend_time, for example: 2018-02-11.
urlstringOptionalThe purge URL to look up.
page_numberstringRequiredPage number, defaults to 1
page_sizestringRequiredNumber of entries per page, defaults to 50.
task_idintRequiredMethod 2: Look up by the task_id returned in the purge response mentioned above.

Sample Request:

Query by Task ID
curl -X GET "https://cdn.api.baishan.com/v2/cache/refresh?token=xx&task_id=2400008"

Query by Time
curl -X GET "https://cdn.api.baishan.com/v2/cache/refresh?token=xxx&start_time=2018-02-23&end_time=2018-02-23&page_number=100"

Query a Specific URL
curl -X GET "https://cdn.api.baishan.com/v2/cache/refresh?token=xxx&start_time=2018-02-24&end_time=2018-02-24&page_number=100&url=http://abc.qingcdn.com/track/main/stat/bandwidth"

Sample Response

Json format.

{
    "code": 0,//Code 0 indicates success.
    "message":"", //// None-0 code indicates an error and an error message will appear.
    "data": {
        "total": 1,
        "page_number": "100",
        "list": [
            {
                "id": "12",
                "url": "http://portal.qingcdn.com/theme/bsc1.7/images/logo.png",
                "type": "url",
                "status": "completed" //// The value could be completed, waiting,processing, and failed.

            }
        ]
    }
}

Sample Parameters:

{
    "start_time": "2018-02-09",
    "end_time": "2018-02-09",
    "page_number": "100",
    "url": "http://portal.qingcdn.com/theme/bsc1.7/images/logo.png"
}

Response Header

HTTP/1.0 200 OK
Api-Id:                70946227
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute  //API Rate limit time unit (minute/hour/day)
X-Ratelimit-Limit:     150  //Maximum number of URLs per time unit
X-Ratelimit-Remaining: 99   //Remaining number of URLs in this time unit
X-Retry-After:         33  // The rate limit resets 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.