Last updated:2021-03-17 11:07:41
You can call this operation to configure hotlinking prevention based on the timestamp and shared key for a domain name.
Note:
The API request contains the specified directory /2016-09-01/domain/SetRequestAuthConfig, common request headers, and operation-specific request parameters. For more information, see the sample request.
Header | Required | Type | Description |
---|---|---|---|
X-Version | Yes | String | The version number. Set the value to 2016-09-01. |
X-Action | Yes | String | The operation that you want to perform. Set the value to SetRequestAuthConfig. |
Parameter | Required | Type | Description |
---|---|---|---|
DomainId | Yes | String | The ID of the domain name. |
Enable | Yes | String | Specifies whether to enable hotlinking prevention based on the timestamp and shared key. Valid values: on and off. Default value: off. If the Enable parameter is set to on, the AuthType, Key1 and ExpirationTime parameters are required. If the Enable parameter is set to off, the following parameters are ignored. |
AuthType | Yes | String | The hotlinking prevention type. Valid values: typeA and typeB. Default value: typeA. This parameter is required if the Enable parameter is set to on. For more information, see the description below. |
Key1 | Yes | String | The primary shared key, which must be 6 to 128 characters in length and can contain uppercase or lowercase letters (A to Z or a to z) and digits (0 to 9). |
Key2 | No | String | The secondary shared key, which must be 6 to 128 characters in length and can contain uppercase or lowercase letters (A to Z or a to z) and digits (0 to 9). |
ExpirationTime | Yes | Long | The expiration time. Unit: seconds. Valid values: 0 to 31536000. |
Sample request
GET method:
GET /2016-09-01/domain/SetRequestAuthConfig?DomainId=2D09XC0&Enable=on& AuthType=typeA& Key1=qwerqyt& ExpirationTime=3600
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: SetRequestAuthConfig
x-version: 2016-09-01
POST method:
POST /2016-09-01/domain/SetRequestAuthConfig
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: SetRequestAuthConfig
x-version: 2016-09-01
Content-Type: application/json
{
"DomainId":"2D08M8V",
"Enable":"on",
"AuthType":"typeA",
"Key1":"qwerqyt",
"ExpirationTime":"3600"
}
Sample response
Did you find the above information helpful?
Please give us your feedback.
Thank you for your feedback.