VI | EN
Message us on Messenger
Developer resources

Conversations — Pancake Chat API

get /pages/{page_id}/conversations · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

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_at chứ 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_at 14:29 UTC = 21:29 giờ VN).
  • type lọ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

NameInTypeSampleDescription
AuthorizationheaderheaderBearer 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_idquerystring107896751234567page_id đã nối — có thể bỏ (lấy từ đường dẫn).

Request parameters

NameInTypeRequiredSampleDescription
page_idpathstringYes107896751234567Mã trang đã nối với 360 (khác trang đã nối → 404).
last_conversation_idquerystringNo107896751234567_7712345678901234Mã 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.
sincequerytimestampNo1793120400Lọ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.
untilquerytimestampNo1793206799Lọc updated_at đến mốc này (Unix giây).
typequerystringNoINBOXChỉ lấy một loại: INBOX (tin nhắn) · COMMENT (bình luận) · LIVESTREAM.
tagsquerystringNo32,36Lọc theo mã nhãn (lấy ở /tags), cách nhau dấu phẩy.
post_idsquerystringNo107896751234567_2188168395246441Lọc hội thoại bình luận theo bài viết.
unread_firstqueryboolNotrueĐưa hội thoại chưa đọc lên trước.
order_byquerystringNoupdated_atupdated_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)

NameTypeSampleDescription
successbooltrue`false` + `message` khi lỗi (HTTP vẫn 200).
conversationsobject[]Tối đa 60 hội thoại, `updated_at` giảm dần.
idstring107896751234567_7712345678901234Mã 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.
typestringINBOX`INBOX` · `COMMENT` · `LIVESTREAM`.
post_idstringnullBài viết (`<page_id>_<mã bài>`) với hội thoại bình luận; `null` với inbox.
snippetstring[Attachment]Đoạn xem trước tin cuối (`[Attachment]` khi tin cuối chỉ có ảnh / mẫu).
message_countint75Số tin (con số tham khảo — có thể lệch vài tin so với số tin đọc được ở API tin nhắn).
seenbooltrueTrang đã đọc.
has_phonebooltrueĐã bắt được SĐT trong hội thoại.
inserted_atstring2025-11-22T03:12:50.209337Tạ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_atstring2026-10-28T14:29:49.000000Hoạt động cuối — giờ UTC.
fromobjectKhách: id (PSID), name, email (dạng `<PSID>@facebook.com`).
last_sent_byobjectNgườ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.
customersobject[]Hồ sơ khách: id (mã khách trên trang), fb_id, name.
customer_idstring48185bee-…Mã khách toàn cục Pancake.
page_customerobjectHồ sơ khách trên trang: id, name, psid, gender, birthday, global_id, notes, recent_orders, inserted_at.
recent_phone_numbersobject[]SĐT bắt được: phone_number, captured (đoạn chữ gốc), m_id (mã tin chứa số), offset, length, status.
tagsobject[]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_historiesobject[]Lịch sử gắn / gỡ nhãn: inserted_at, payload{ action (`add` · `remove`…), editor_id, editor_name, tag{ id, text } }.
assignee_idsstring[][]UUID nhân viên được phân công.
current_assign_usersobject[][]Nhân viên đang phụ trách: id, name, email, fb_id.
assignee_historiesobject[][]Lịch sử phân công.
assignee_group_idstringnullNhóm nhân viên được phân công.
adsobject[]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_idsstring[]["120235393692980041"]Mã quảng cáo (tra tên ở API /ads).
page_idstring107896751234567

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

  1. Sign up for Partner
  2. Enable a data type of the Hội thoại & tin nhắn group on the platform page
  3. Create an API key (tick the Pancake Chat channel)
  4. Call it as in the examples above