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。