API call description
This API is not restricted by the Contacts permission scope.Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/topapi/user/count |
| HTTP Method | POST |
| Supported app types | appType-Internal app, appType-Third-party enterprise app |
| Required permissions | permission-qyapi_get_member-Read permission for user information |
Query parameter
| 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 |
|---|---|---|---|---|
| only_active | Boolean | Yes | false | Whether to include the number of employees who have not activated DingTalk: - false: Include employees who have not activated DingTalk. - true: Only include employees who have activated DingTalk. |
Request example
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| request_id | String | o38h5bztjouc | The request ID. |
| errcode | Number | 0 | The status code. 0 indicates that the call succeeded. |
| errmsg | String | Invalid access_token | The error message returned when the call failed. |
| result | CountUserResponse | The returned result. | |
| count | Number | 4 | The number of employees. |
Response body example
Error codes
If an error is returned when you call this API, refer to the Global error codes document to find a solution based on the error message.| Error code (errcode) | Error message (errmsg) | Solution |
|---|---|---|
| 400002 | Parameter is empty | Make sure all required parameters are provided. |
| 40035 | Invalid parameter | Make sure the parameters meet the requirements in the documentation above. |
| -1 | System busy | Try again later. |