# Create meeting room access code

Create a range of meeting room access codes

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/vc/v1/room_configs/set_room_access_code
HTTP Method | POST
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Update video conference meeting room information(vc:room)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Request body

Parameter | Type | Required | Description
---|---|---|---
scope | int | Yes | Set node range<br>**Example value**: 5<br>**Optional values are**:<br>- 1：Tenant<br>- 2：Country/region<br>- 3：City<br>- 4：Building<br>- 5：Floor<br>- 6：Room
country_id | string | No | This parameter is required when the country ID scope is 2, 3<br>**Example value**: "1"
district_id | string | No | This parameter is required when the city ID scope is 3<br>**Example value**: "2"
building_id | string | No | This parameter is required when the building ID scope is 4, 5<br>**Example value**: "3"
floor_name | string | No | This parameter is required when the floor scope is 5<br>**Example value**: "4"
room_id | string | No | This parameter is required when the conference room ID scope is 6<br>**Example value**: "67687262867363"
valid_day | int | Yes | Effective days<br>**Example value**: 1<br>**Optional values are**:<br>- 1：1 day<br>- 7：7 days<br>- 30：30 days

### Request body example
```json
{
    "scope": 5,
    "country_id": "1",
    "district_id": "2",
    "building_id": "3",
    "floor_name": "4",
    "room_id": "67687262867363",
    "valid_day": 1
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
access_code | string | access code

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "access_code": "YNMLTJOUZ"
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
500 | 121001 | internal error | Internal server error. If retry still doesn't work, contact the administrator.
400 | 121002 | not support | This function is not supported.
400 | 121003 | param error | Parameter error. Check the value range of parameters (please check yourself according to the field description above).
404 | 121004 | data not exist | The requested data doesn't exist.

