get /pages/{page_id}/conversations
GET/public_api/v2/pages/{page_id}/conversationsVia 360: GET https://partner.quantri360.com/v1/pancake_chat/public_api/v2/pages/{page_id}/conversations
Coming soon. This API already runs in production through 360 and pricing is being finalised — you can read the docs and prepare your integration now.
Description
Danh sách hội thoại của trang (inbox + bình luận), 60 hội thoại / lần, mới cập nhật trước: khách, đoạn tin cuối, số tin, nhãn, nhân viên được phân công, SĐT bắt được, quảng cáo khách đã bấm. Dùng để quét hội thoại mới / vừa có tin, lấy id hội thoại cho API tin nhắn, đếm hội thoại theo nhãn hoặc theo quảng cáo.
- Không bắt buộc since / until (bỏ trống → 60 hội thoại mới cập nhật nhất). since / until lọc theo
updated_atchứ không theo ngày tạo: hội thoại tạo từ năm trước nhưng hôm nay có tin vẫn lọt vào. - Thời gian ở API này là giờ UTC (vd
updated_at14:29 UTC = 21:29 giờ VN). typelọc đúng một loại; danh sách không lọc trộn cả INBOX và COMMENT.- Phản hồi chứa tên, SĐT khách — chỉ lưu ở nơi có kiểm soát quyền. Pancake giới hạn 5 lượt / giây / trang.
Request
Endpoint
GET https://partner.quantri360.com/v1/pancake_chat/public_api/v2/pages/{page_id}/conversations
Authentication & shop
| Name | In | Type | Sample | Description |
|---|---|---|---|---|
| Authorization | header | header | Bearer q360_live_ab12cd34_… | Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand. |
| platform_shop_id | query | string | 107896751234567 | page_id đã nối — có thể bỏ (lấy từ đường dẫn). |
Request parameters
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| page_id | path | string | Yes | 107896751234567 | Mã trang đã nối với 360 (khác trang đã nối → 404). |
| last_conversation_id | query | string | No | 107896751234567_7712345678901234 | Mã hội thoại CUỐI của lần gọi trước → trả 60 hội thoại tiếp theo (cũ hơn). Bỏ trống = 60 hội thoại mới cập nhật nhất. |
| since | query | timestamp | No | 1793120400 | Lọc theo thời điểm CẬP NHẬT hội thoại (updated_at) từ mốc này (Unix giây). Không bắt buộc. |
| until | query | timestamp | No | 1793206799 | Lọc updated_at đến mốc này (Unix giây). |
| type | query | string | No | INBOX | Chỉ lấy một loại: INBOX (tin nhắn) · COMMENT (bình luận) · LIVESTREAM. |
| tags | query | string | No | 32,36 | Lọc theo mã nhãn (lấy ở /tags), cách nhau dấu phẩy. |
| post_ids | query | string | No | 107896751234567_2188168395246441 | Lọc hội thoại bình luận theo bài viết. |
| unread_first | query | bool | No | true | Đưa hội thoại chưa đọc lên trước. |
| order_by | query | string | No | updated_at | updated_at (mặc định) · inserted_at. |
Pagination
Mỗi lần tối đa 60 hội thoại. Lấy id của phần tử CUỐI gửi vào last_conversation_id để lấy 60 hội thoại kế tiếp; trả < 60 (hoặc rỗng) là hết.
Request examples
curl -s "https://partner.quantri360.com/v1/pancake_chat/public_api/v2/pages/107896751234567/conversations?type=INBOX&since=1793120400&until=1793206799" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/pancake_chat/public_api/v2/pages/107896751234567/conversations",
params={
"type": "INBOX",
"since": 1793120400,
"until": 1793206799
},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
print(r.status_code)
print(r.json())Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/pancake_chat/public_api/v2/pages/107896751234567/conversations');
for (const [k, v] of Object.entries({"type":"INBOX","since":1793120400,"until":1793206799})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'GET',
headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());PHP
<?php $key = 'q360_live_...'; // khóa API của brand $url = 'https://partner.quantri360.com/v1/pancake_chat/public_api/v2/pages/107896751234567/conversations' . '?' . http_build_query(['type' => 'INBOX', 'since' => 1793120400, 'until' => 1793206799]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]); $res = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status, "\n", $res;
Response
Response fields (as returned by Pancake Chat)
| Name | Type | Sample | Description |
|---|---|---|---|
| success | bool | true | `false` + `message` khi lỗi (HTTP vẫn 200). |
| conversations | object[] | Tối đa 60 hội thoại, `updated_at` giảm dần. | |
| id | string | 107896751234567_7712345678901234 | Mã hội thoại: inbox = `<page_id>_<PSID khách>`; bình luận = `<mã bài>_<mã bình luận>`. Dùng cho API tin nhắn. |
| type | string | INBOX | `INBOX` · `COMMENT` · `LIVESTREAM`. |
| post_id | string | null | Bài viết (`<page_id>_<mã bài>`) với hội thoại bình luận; `null` với inbox. |
| snippet | string | [Attachment] | Đoạn xem trước tin cuối (`[Attachment]` khi tin cuối chỉ có ảnh / mẫu). |
| message_count | int | 75 | Số tin (con số tham khảo — có thể lệch vài tin so với số tin đọc được ở API tin nhắn). |
| seen | bool | true | Trang đã đọc. |
| has_phone | bool | true | Đã bắt được SĐT trong hội thoại. |
| inserted_at | string | 2025-11-22T03:12:50.209337 | Tạo hội thoại — giờ UTC (cộng 7 giờ ra giờ VN), có thể kèm phần lẻ micro giây. |
| updated_at | string | 2026-10-28T14:29:49.000000 | Hoạt động cuối — giờ UTC. |
| from | object | Khách: id (PSID), name, email (dạng `<PSID>@facebook.com`). | |
| last_sent_by | object | Người gửi tin cuối: id (trùng page_id = trang gửi), name, admin_name, uid (UUID nhân viên), ai_generated, is_automated. | |
| customers | object[] | Hồ sơ khách: id (mã khách trên trang), fb_id, name. | |
| customer_id | string | 48185bee-… | Mã khách toàn cục Pancake. |
| page_customer | object | Hồ sơ khách trên trang: id, name, psid, gender, birthday, global_id, notes, recent_orders, inserted_at. | |
| recent_phone_numbers | object[] | SĐT bắt được: phone_number, captured (đoạn chữ gốc), m_id (mã tin chứa số), offset, length, status. | |
| tags | object[] | Nhãn đang gắn: id, text, color, lighten_color, is_lead_event. Có thể chứa phần tử `null` (nhãn đã xóa). | |
| tag_histories | object[] | Lịch sử gắn / gỡ nhãn: inserted_at, payload{ action (`add` · `remove`…), editor_id, editor_name, tag{ id, text } }. | |
| assignee_ids | string[] | [] | UUID nhân viên được phân công. |
| current_assign_users | object[] | [] | Nhân viên đang phụ trách: id, name, email, fb_id. |
| assignee_histories | object[] | [] | Lịch sử phân công. |
| assignee_group_id | string | null | Nhóm nhân viên được phân công. |
| ads | object[] | Các lần khách bấm quảng cáo vào hội thoại: ad_id, post_id, inserted_at. | |
| ad_ids | string[] | ["120235393692980041"] | Mã quảng cáo (tra tên ở API /ads). |
| page_id | string | 107896751234567 |
Response sample
{
"success": true,
"conversations": [
{
"id": "107896751234567_7712345678901234",
"type": "INBOX",
"post_id": null,
"page_id": "107896751234567",
"snippet": "Dạ vâng ạ",
"seen": true,
"message_count": 25,
"has_phone": true,
"inserted_at": "2025-11-22T03:12:50.209337",
"updated_at": "2026-10-28T14:29:49.000000",
"from": {
"id": "7712345678901234",
"name": "Khách hàng A",
"email": "7712345678901234@facebook.com"
},
"last_sent_by": {
"id": "107896751234567",
"name": "Trang ABC",
"email": "107896751234567@facebook.com",
"ai_generated": false
},
"customers": [
{
"id": "9ab58bd5-ad17-48c2-…",
"fb_id": "7712345678901234",
"name": "Khách hàng A"
}
],
"customer_id": "48185bee-039f-49b9-…",
"recent_phone_numbers": [
{
"phone_number": "0901234567",
"captured": "0901234567",
"m_id": "m_ozAI5q…",
"offset": 0,
"length": 10,
"status": 3
}
],
"tags": [
{
"id": 32,
"text": "bước 1",
"color": "#4b5577",
"lighten_color": "rgba(75,85,119,0.4)"
}
],
"tag_histories": [
{
"inserted_at": "2025-11-22T03:12:56.074089",
"conversation_id": "107896751234567_7712345678901234",
"payload": {
"action": "add",
"editor_id": "44d4e026-…",
"editor_name": "Nhân viên B",
"tag": {
"id": 32,
"text": "bước 1"
}
}
}
],
"assignee_ids": [],
"current_assign_users": [],
"assignee_histories": [],
"assignee_group_id": null,
"ads": [
{
"ad_id": "120235393692980041",
"inserted_at": "2025-11-22T03:15:33",
"post_id": "107896751234567_849023651214390"
}
],
"ad_ids": [
"120235393692980041"
]
}
]
}
Get started
- Sign up for Partner
- Enable a data type of the Hội thoại & tin nhắn group on the platform page
- Create an API key (tick the Pancake Chat channel)
- Call it as in the examples above