EdgeNext
Documentation home

EdgeNext Documentation

Product guides, setup instructions, and technical references.

CDN

Purge Query

API Endpoint

Request URL: cache/refresh (GET)

Interface request domain name: cdn.api.edgenext.com

Interface version: v2

API Description

Query the status of URL refresh. For frequency limits, refer to the response (response header).

Note: Refresh task records are only retained for one month (the span of a single query is 7 days). Please query and save the relevant refresh status within this period.

Input Parameters

Public parameter: The user's token can be obtained from on-duty colleagues.

Request Parameters (GET)

Parameters are added to the query part of the URL, e.g.: ?key1=value1&key2=value2

Parameter Name Data Type Required Description
start_time string Yes Start time: e.g. 2018-02-11. The combination of [start_time, end_time, url] is one query method, which is mutually exclusive with the task_id query method.
end_time string Yes End time: e.g. 2018-02-11
url string No The URL whose refresh status needs to be queried. This parameter is not mandatory.
page_number string Yes The page number to retrieve, default is 1
page_size string Yes Pagination size, default is 50
task_id int Yes Query method 2: Query by task_id, which queries the refresh status of all URLs submitted in a single task

Request Examples:

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

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

# Query the status of a specific URL
curl -X GET "https://cdn.api.edgenext.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"

Return Example

{
    "code": 0,//code = 0 means the request is normal/successful
    "message":"", //When code is not 0 (request abnormal), this field will be added to describe the error
    "data": {
        "total": 1,
        "page_number": "100",
        "list": [
            {
                "id": "12",
                "url": "http://portal.qingcdn.com/theme/bsc1.7/images/logo.png",
                "type": "url",
                "status": "completed" //status values: completed (finished), waiting (pending), processing (in progress), failed (failed)
            }
        ]
    }
}

Example 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 (Response Header)

HTTP/1.0 200 OK
Api-Id:                70946227
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute  //Interface call frequency limit granularity (minute/hour/day)
X-Ratelimit-Limit:     150  //Current upper limit of requests per minute
X-Ratelimit-Remaining: 99   //Remaining number of requests per minute
X-Retry-After:         33  //The request limit for the current granularity (minute/hour/day) will be reset after xx seconds

HTTP Status Code Description

Error Status Code Description
404 The URL you entered is incorrect
401 Authentication error: your token is incorrect, or you do not have interface access permissions
400 Invalid request parameters
200 Execution successful, returns the requested data
5xx Please contact on-duty colleagues

Need help? Contact our support team at support@edgenext.com.

Back to documentation home