接收事件
conversation.history
WhatsApp 喺啟動或者重連之後同步咗某個會話嘅近期歷史訊息。
事件載荷
{
"id": "evt_wa_history_10001_8613912345678@s.whatsapp.net",
"type": "conversation.history",
"provider": "whatsapp",
"account_id": "acc_8c21d0",
"occurred_at": "2026-06-08T12:46:00Z",
"data": {
"conversation": { "id": "8613912345678@s.whatsapp.net", "type": "user" },
"messages": [
{
"id": "3EB0A1",
"type": "text",
"text": "Previous order question",
"direction": "inbound",
"sent_at": "2026-06-08T11:58:12Z",
"sender": { "id": "8613912345678@s.whatsapp.net" }
},
{
"id": "3EB0A2",
"type": "image",
"direction": "inbound",
"sent_at": "2026-06-08T11:59:20Z",
"sender": { "id": "8613912345678@s.whatsapp.net" },
"attachments": [
{
"type": "image",
"url": "https://unifyport-media.oss-cn-hongkong.aliyuncs.com/pro/1/whatsapp/10001/history.jpg?Expires=1749387560&Signature=...",
"mimetype": "image/jpeg"
}
]
}
]
}
}備註
- 某個 WhatsApp 會話嘅一批 HistorySync 資料。data.conversation 標識會話,data.messages[] 按時間正序包含近期訊息;每條訊息帶 id、type、direction、sent_at、sender、text 同/或者 attachments。
- 呢個係用於首次接入同重連補齊嘅近期歷史,唔係全量封存。服務會限制會話數量同每個會話嘅訊息數量;更早嘅媒體可能標記為 expired,而唔係帶 url。