# Danh sách hội thoại

* Lấy danh sách hội thoại.

## Request

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

```curl
curl --location 'https://vpage.open.nhanh.vn/v3.0/conversation/list?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json' \
--data '{
    "filters": { },
    "paginator": {
        "size": 30, 
        "sort": {"updatedAt": "desc"}
    }
}'
```

### Filters

| Key      | Type                 | Description                                  |
| -------- | -------------------- | -------------------------------------------- |
| pageIds  | array                | Danh sách pageIds muốn lấy hội thoại         |
| type     | int                  | Loại hội thoại. 1: Bình luận, 2: Tin nhắn    |
| hasPhone | boolean (true/false) | Hội thoại có/không có số điện thoại.         |
| hasReply | boolean (true/false) | Hội thoại đã trả lời/chưa trả lời.           |
| status   | int                  | Trạng thái hội thoại. 1: Chưa đọc, 2: Đã đọc |
| tagIds   | array                | Hội thoại đã gắn những tagIds này            |
| postIds  | array                | Hội thoại phát sinh từ những postIds này     |

### 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

| Value       | Description                       | Sort      |
| ----------- | --------------------------------- | --------- |
| updatedTime | Thời gian tương tác của hội thoại | 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": [
            1742545330,
            6478
        ]
    },
    "data": [
        {
            "id": "331526780045341_7521482117936821",
            "channel": 1,
            "type": 2,
            "customerAvatar": "https://example.com/user_1.jpg",
            "pageId": "331526780045341",
            "pageUserId": "7521482117936821",
            "pageUserName": "Linhgfx",
            "hasReply": true,
            "assignedGroupId": "",
            "hasPhone": true,
            "createdAt": 1718878288,
            "updatedAt": 1742803465,
            "lastSeenMessageAt": 1742827806,
            "lastMessage": "[Send sticker]",
            "status": 2,
        },
        {
            "id": "101286204573840_1075546127814826_101286204573840",
            "type": 1,
            "channel": 1,
            "hasPhone": false,
            "hasReply": true,
            "lastMessage": "hi dev vp Trung Nguyễn cmt\npa\ncmt3 0987695050\ncmt2 0987695050\ncmt1 0987695050",
            "status": 2,
            "customerAvatar": "https://example.com/user_2.jpg",
            "isFromLive": 1,
            "createdAt": 1749876899,
            "updatedAt": 1751353509,
            "pageUserName": "Tạp Chí Ò ó o",
            "pageUserId": "101286204573840",
            "pageId": "101286204573840",
            "pagePostId": "101286204573840_1075546127814826"
        }
    ]
}
```


---

# 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/conversation/conversation_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.
