# Danh sách user

* Lấy danh sách [nhân viên trên Vpage](https://vpage.nhanh.vn/app/setting/user).
* **Chú ý**:
  * Dữ liệu này ít thay đổi, khuyến cáo bạn nên cache lại trong vòng 8h để tránh gọi API liên tục.
  * User ở Vpage khác với [user ở POS](/v3/business/user.md), nếu user ở vpage có liên kết với POS, thì response sẽ có thêm field là posUid.

## Request

* Xem sample Postman [tại đây](https://www.postman.com/nhanh-vn/vpage-open-nhanh-vn/request/ygbdwk2/user-list?tab=body).

```curl
curl --location 'https://vpage.open.nhanh.vn/v3.0/user/list?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json' \
--data '{
    "filters": {
      "userIds": ["userId_1", "userId_2"]
    },
    "paginator": {
        "size": 50, 
        "sort": {"createdAt": "desc"}
    }
}'
```

### Filters

| Key     | Type  | Description                                                                       |
| ------- | ----- | --------------------------------------------------------------------------------- |
| userIds | array | Không truyền field này để lấy toàn bộ user, hoặc truyền 1 mảng các user mong muốn |

### Paginator

| Key  | Type  | Description                                                |
| ---- | ----- | ---------------------------------------------------------- |
| size | int   | Số lượng bản ghi trên 1 trang. Tối đa không quá 50         |
| next | array | Mảng dữ liệu next (được trả về từ trang trước đó - nếu có) |
| sort | array | Mảng dữ liệu các tiêu chí sort. Xem bảng bên dưới          |

* sort

| Key       | Description        | Value     |
| --------- | ------------------ | --------- |
| createdAt | Thời gian tạo user | ASC, DESC |

## Response

* Xem cấu trúc chung [tại đây](/v3/readme.md#response).

### Failed response

* Xem các mã lỗi chung [tại đây](/v3/readme.md#failed-response).

### Successful response

```json
{
    "code": 1,
    "paginator": {
        "next": [
            1684232267000,
            13
        ]
    },
    "data": [
        {
            "id": "562525723619135",
            "displayName": "Nhân viên 2",
            "posUid": "id nhân viên bên Nhanh.vn",
            "posName": "Tên nhân viên bên Nhanh.vn",
            "createdAt": 1743839994
        },
        {
            "id": "596777126857368",
            "displayName": "Nhân viên 1",
            "posUid": "id nhân viên bên Nhanh.vn",
            "createdAt": 1743839994
        }
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.nhanh.vn/v3/vpage/user_list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
