Custom Purge
This API is used to refresh cached content on edge nodes based on a custom URL pattern.
Request
Request-Line
POST /cdn/v1.0/services/{serviceId}/customPurge HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | The unique identifier of the service. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| operator | String | Mandatory | The operator used to match the URL pattern. Supported values: startswith or endswith. |
| pattern | String | Mandatory | The URL pattern to purge. Must start with / when the operator is startswith. |
Response
Response Body
| Parameter | Type | Description |
|---|---|---|
| batchId | Int | The unique identifier of the purge batch. |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | Request.BadRequest | Bad request. |
| 400 | InvalidCustomer.IdEmpty | Customer ID cannot be empty or invalid. |
| 400 | InvalidService.IdIncorrect | Service ID is empty or invalid. |
| 400 | InvalidService.IdPermission | Service ID cannot be found or unknown. |
| 400 | InvalidPurge.Pattern | The pattern is required. |
| 400 | InvalidPurge.PatternFormat | The pattern must be start with '/' when operator is startswith. |
Examples
Create Purge
Request
POST /cdn/v1.0/services/97856/customPurge HTTP/1.1
{
"operator":"startswith",
"pattern":"/"
}
Successful Response Body
{
"batchId": 2
}