Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/topapi/role/scope/update |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Required permissions | permission-qyapi_manage_addresslist-Contacts data management permission |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | Be3xxxx | The app credential for calling this API. Obtain it through the API for obtaining the access_token of an internal app. |
Request body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| userid | String | Yes | EMP123 | The user ID of the employee in the organization. |
| role_id | Number | Yes | 12345 | The role ID. Call the Obtain a list of organization roles API to obtain the value of the id parameter. |
| dept_ids | String | No | 1231 | The list of department IDs. Separate multiple department IDs with commas. A maximum of 50 department IDs are supported. If left empty, the scope is set to all users. |
Request example
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| request_id | String | 4pe0h4hlsit9 | The request ID. |
Response body example
Error codes
If an error is returned when calling this API, find the solution in the Global error codes document based on the error message.| Error code (errcode) | Error code description (errmsg) | Solution |
|---|---|---|
| 40003 | Invalid userId | Verify that the userId is correct. |
| 34018 | role_id cannot be empty | Provide the roleId. |
| 60301 | Invalid role_id | Verify that the role_id is correct. |
| 60003 | Department does not exist | Verify that the dept_ids are correct. |
| 46004 | Employee is not in the organization | Verify that the parameters are correct. |
| 400002 | Invalid parameter | Verify that the request parameters are correct. |
| -1 | System busy | Try again later. |