# Set up Object Storage Anti-leech - SetUFileReferer

## Overview

Set up Object Storage Anti-leech






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `SetUFileReferer`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |No|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **BucketName** | string | Storage Space Name |**Yes**|
| **RefererStatus** | string | Enable or disable referer anti-leeching; Disabling anti-leeching will clear the anti-leeching parameter settings, enabling anti-leeching must specify RefererType, Referers; Enable: on, Disable: off; |**Yes**|
| **RefererAllowNull** | boolean | When RefererType is set to whitelist, setting RefererAllowNull to false means that empty referer access is not allowed, while setting it to true means that empty referer access is allowed; <br />This parameter is set to true by default. |No|
| **RefererType** | int | Anti-theft chain Referer type, supports three types,<br />1 represents setting a blacklist, 2 represents setting a whitelist,<br />3 represents setting both blacklist and whitelist; (1 and 2 are for backward compatibility, subsequent calls should only pass type 3)<br />This parameter must be filled in when RefererStatus is "on"; |No|
| **Referers.N** | string | Anti-theft chain Referer rule, supports regular expressions (does not support the symbol ';'), this field has been deprecated, please use WhiteList.n or BlackList.n |No|
| **WhiteList.N** | string | An item in the whitelist |No|
| **BlackList.N** | string | An item in the blacklist |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|




## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=SetUFileReferer
&Region=cn-zj
&ProjectId=EhCcaLxv
&BucketName=XvqwhKrY
&RefererType=ZzOlNzdj
&Referers.n=iaEJuvtY
&NullReferer=MrViJqjQ
&RefererStatus=开启：on; 关闭：off;
&RefererStatus=开启：on; 关闭：off;
&WhiteList.n=ZTziAPAx
&BlackList.n=gRpnOElW
&WhiteList.n=jCEtMJTO
&BlackList.n=CuicHvDo
&WhiteList.n=dQxkpotm
&BlackList.n=DhqOJukG
```

### Response Example
    
```json
{
  "Action": "SetUFileRefererResponse",
  "RetCode": 0
}
```





