Found 0 result in total

Content is empty
If you don't find the content you expect, please try another search term
Content Delivery Network (CDN)
API Documentation
Domain Detailed Configuration
SetReferProtectionConfig
Last updated:2021-03-17 10:56:10
You can call this operation to configure referer-based hotlinking prevention for a domain name. This feature is disabled by default after a domain name is added.
The API request contains the specified directory /2016-09-01/domain/SetReferProtectionConfig, common request headers, and operation-specific request parameters. For more information, see the sample request.
| Parameter | Required | Type | Description |
|---|---|---|---|
| DomainId | Yes | String | The ID of the domain name. |
| Enable | Yes | String | Specifies whether to enable referer-based hotlinking prevention. Valid values: on and off. Default value: off. If the Enable parameter is set to on, the ReferType parameter is required. If the Enable parameter is set to off, the following parameters are ignored. |
| ReferType | Yes | String | The type of the referer list. Valid values: block (blacklist) and allow (whitelist). This parameter is required if the Enable parameter is set to on. |
| ReferList | No | String | The referers. Separate multiple referers with commas (,). |
| AllowEmpty | No | String | Specifies whether to allow access without referers. Valid values: on and off. Default value: on. |
Sample request
GET method:
GET /2016-09-01/domain/SetReferProtectionConfig?DomainId=2D08M8V&Enable=off&ReferType=block&ReferList=www.test.com
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: SetReferProtectionConfig
x-version: 2016-09-01
POST method:
POST /2016-09-01/domain/SetReferProtectionConfig
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: SetReferProtectionConfig
x-version: 2016-09-01
Content-Type: application/json
{
"DomainId": "2D08M8V",
"Enable": "off",
"ReferType": "block",
"ReferList": "www.test.com"
}
Sample response
Pure Mode