Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/topapi/role/getrole |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-qyapi_get_department_member-Read permission for Contacts department users |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | bE74xxxx | The app credential used to call this API. - For an internal app, obtain it through the API for getting the access_token of an internal app. - For a third-party enterprise app, obtain it through the API for getting the access_token of a third-party enterprise. |
Request body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| roleId | Number | Yes | 1581321999 | The role ID. To get the value of the id parameter, call the Get role list API. |
Request example
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| role | OpenRole | The role information. | |
| name | String | Owner | The role name. |
| groupId | Number | 1507113577 | The ID of the role group that the role belongs to. |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| request_id | String | 4cmr6app8ujf | The request ID. |
Response example
Error codes
If an error occurs when you call this API, find the solution in the Global error codes document based on the error message.| Error code (errcode) | Error message (errmsg) | Solution |
|---|---|---|
| 33011 | Invalid roleId | Verify that the roleId is correct. |
| 43007 | Operation permission required | Verify that the access_token has the required permissions. |
| 400001 | System error | Try again later. |