Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/topapi/v2/user/getuserinfo |
| HTTP Method | POST |
| Supported app types | appType-Internal appappType-Third-party enterprise app |
| Required permissions | permission-qyapi_base-Basic permissions required to call enterprise APIs |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 6ed1bxxx | The app credential used to call this API. - For an internal app, obtain it through the API to get the access_token of an internal app. - For a third-party enterprise app, obtain it through the API to get the access_token of a third-party enterprise. |
Request body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| code | String | Yes | bab02f63c1e030fbbxxxx | The silent login authorization code. For how to obtain it, see: - Silent login authorization code for a mini program - Silent login authorization code for a micro app Note This authorization code is valid for 5 minutes and can be used only once. |
Request example
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| request_id | String | e8krly4vyiln | The request ID. |
| errcode | Number | 0 | The return code**.** |
| errmsg | String | ok | The text description of the return code. |
| result | UserGetByCodeResponse | The returned result. | |
| userid | String | user456 | The user ID of the user. |
| device_id | String | 12drtfxxxxx | The device ID. |
| sys | Boolean | true | Indicates whether the user is an admin. - true: Yes - false: No |
| sys_level | Number | 1 | The admin level. - 1: Super Admin - 2: Sub Admin - 100: Boss - 0: Other (such as a regular employee) |
| associated_unionid | String | N2o5U3axxxx | The unionId associated with the user. |
| unionid | String | gliiW002zUxxxx | The unionId of the user. |
| name | String | Zhang xx | The name of the user. |