> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get basic information about department users

> Call this API to get basic information about users in a specified department, used for lightweight user list display.

Call this API to get basic information about users in a specified department.

## API call description

* This API only returns the userId and name fields of users. To get detailed user information, see [Get the complete information of a department user](/open/development/queries-the-complete-information-of-a-department-user).
* This API only returns basic information about users in the current department. Information about users in sub-departments is not returned.

## Request

| **Basic information** |                                                                                                  |
| --------------------- | ------------------------------------------------------------------------------------------------ |
| HTTP URL              | [https://api.dingtalk.io/topapi/user/listsimple](https://api.dingtalk.io/topapi/user/listsimple) |
| HTTP Method           | POST                                                                                             |
| Supported app types   | appType-Internal app appType-Third-party enterprise app                                          |
| Permissions           | permission-qyapi\_get\_department\_member-Read permission for Contacts department users          |

### 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 that gets the [access\_token of an internal app](/open/development/obtain-orgapp-token). - For a third-party enterprise app, obtain it through the API that gets the access\_token of a third-party enterprise. |

### Request body

| Name                   | Type    | Required | Example      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ---------------------- | ------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dept\_id               | Number  | Yes      | 10           | The department ID. For the root department, pass 1. Call [Get the department list](/open/development/user-management-acquires-the-list-departments) to get the value of dept\_id.                                                                                                                                                                                                                                                                                                                              |
| cursor                 | Number  | Yes      | 0            | The cursor for pagination. Pass 0 for the first request, and pass the next\_cursor value from the response in subsequent requests.                                                                                                                                                                                                                                                                                                                                                                             |
| size                   | Number  | Yes      | 10           | The page size. The maximum value is 100.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| order\_field           | String  | No       | modify\_desc | The sorting rules for department users. The default value is **custom**.   - **entry\_asc**: sort by the time of joining the department in ascending order. - **entry\_desc**: sort by the time of joining the department in descending order. - **modify\_asc**: sort by the modified time of department information in ascending order. - **modify\_desc**: sort by the modified time of department information in descending order. - **custom**: user-defined sorting (sorted by pinyin when not defined). |
| contain\_access\_limit | Boolean | No       | false        | Whether to return users with restricted access.   - **true**: Yes - **false**: No                                                                                                                                                                                                                                                                                                                                                                                                                              |
| language               | String  | No       | zh\_CN       | The language of Contacts.   - **zh\_CN**: Chinese (default). - **en\_US**: English.                                                                                                                                                                                                                                                                                                                                                                                                                            |

### Request example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/user/listsimple" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=c1f2d110-4e7c-4536-a340-06652613e0c1' \
-d 'contain_access_limit=false' \
-d 'cursor=0' \
-d 'dept_id=10' \
-d 'language=zh_CN' \
-d 'order_field=modify_desc' \
-d 'size=10'
```

Java

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/user/listsimple");
OapiUserListsimpleRequest req = new OapiUserListsimpleRequest();
req.setDeptId(10L);
req.setCursor(0L);
req.setSize(10L);
req.setOrderField("modify_desc");
req.setContainAccessLimit(false);
req.setLanguage("zh_CN");
OapiUserListsimpleResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiUserListsimpleRequest("https://api.dingtalk.io/topapi/user/listsimple")

req.dept_id=10
req.cursor=0
req.size=10
req.order_field="modify_desc"
req.contain_access_limit=false
req.language="zh_CN"
try:
  resp= req.getResponse(access_token)
  print(resp)
except Exception,e:
  print(e)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiUserListsimpleRequest;
$req->setDeptId("10");
$req->setCursor("0");
$req->setSize("10");
$req->setOrderField("modify_desc");
$req->setContainAccessLimit("false");
$req->setLanguage("zh_CN");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/user/listsimple");
```

C#

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/user/listsimple");
OapiUserListsimpleRequest req = new OapiUserListsimpleRequest();
req.DeptId = 10L;
req.Cursor = 0L;
req.Size = 10L;
req.OrderField = "modify_desc";
req.Language = "zh_CN";
req.ContainAccessLimit = false;
req.Language = "zh_CN";
OapiUserListsimpleResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response body

| Name         | Type                      | Example      | Description                                                                               |
| ------------ | ------------------------- | ------------ | ----------------------------------------------------------------------------------------- |
| request\_id  | String                    | 4f9md9obopn2 | The request ID.                                                                           |
| errcode      | Number                    | 0            | The return code. 0 indicates success.                                                     |
| errmsg       | String                    | ok           | The description of the return code.                                                       |
| result       | PageResult                |              | The returned result.                                                                      |
| has\_more    | Boolean                   | true         | Whether more data is available.   - **true**: Yes - **false**: No                         |
| next\_cursor | Number                    | 10           | The cursor for the next page. If has\_more is false, no more paginated data is available. |
| list         | ListUserSimpleResponse\[] |              | The user information list.                                                                |
| userid       | String                    | zxxxxx       | The userid of the user.                                                                   |
| name         | String                    | Zhang San    | The user name.                                                                            |

### Response body example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "errmsg": "ok",
  "result": {
    "has_more": false,
    "list": [
      {
        "name": "Test User 2",
        "userid": "user100"
      },
      {
        "name": "Li Si",
        "userid": "user1"
      }
    ]
  },
  "request_id": "x4p6arvi0fzj"
}
```

### Error codes

If an error occurs when you call this API, find the solution in the [Global error codes](/open/development/server-api-error-codes-1) document based on the error message.

| Error code (errcode) | Error message (errmsg)      | Solution                                                  |
| -------------------- | --------------------------- | --------------------------------------------------------- |
| 400002               | Invalid parameter           | Make sure the parameters are filled in as required above. |
| 60003                | The department is not found | Make sure the department ID is correct.                   |
| 40069                | Invalid size                | Adjust the page size.                                     |
| 40068                | Invalid offset              | Adjust the offset.                                        |
| -1                   | System busy                 | Try again later.                                          |
