Development Document

Cache Prewarm Status Download PDF Document

Endpoint

Request URL: URL: cache/prefetch (GET)

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

Endpoint Description

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

Notice: Prewarm request statuses will only be kept for a month. Please make sure to record the statuses before the expiration date.

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.
urlsstringOptionalThe 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 'https://cdn.api.baishan.com/v2/cache/prefetch?token=xx&task_id=30042314'

Query by Time
curl -X GET "https://cdn.api.baishan.com/v2/cache/prefetch?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/prefetch?token=xxx&start_time=2018-02- 24&end_time=2018-02-24&page_number=100&url=http://abc.qingcdn.com/domain/fun/info"
 

Sample Response

Json format.

{
    "code": 0,// Code 0 indicates success
    "message":"", // Error message (when code is not 0)
    "data": {
        "total": 1,
        "page_number": 1,
        "list": [
            {
                "id": "3251371549",
                "url": "http://portal.qingcdn.com/theme/bsc1.7/images/logo.png",
                "status": "completed" // The statuses are completed, waiting, processing, and failed.
            }
        ]
    }
}

Sample Response

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

Response Header

HTTP/1.0 200 OK
Api-Id:                70945467
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:         31// 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.