API 參考
接收事件

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。