logo文件
搜尋

Webhook回調事件

對話建立

當使用者透過呼叫API建立新對話成功時,API通道配置的webhook地址將接收對話建立回呼事件。

{ "account": { "id": 17629000001207, "name": "1112" }, "additional_attributes": {}, "can_reply": true, "channel": "Channel::Api", "contact_inbox": { "id": 42213404, "contact_id": 42218348, "inbox_id": 523, "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588", "created_at": "2026-01-21T03:26:49.012Z", "updated_at": "2026-01-21T03:26:49.012Z", "hmac_verified": false, "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni" }, "id": 89, "inbox_id": 523, "messages": [], "labels": [], "meta": { "sender": { "additional_attributes": {}, "custom_attributes": {}, "email": "alice@acme.inc", "id": 42218348, "identifier": null, "name": "Test", "phone_number": "+123456789", "thumbnail": "", "blocked": false, "type": "contact" }, "assignee": null, "team": null, "hmac_verified": false, "channel": "Channel::Api" }, "status": "open", "custom_attributes": {}, "snoozed_until": null, "unread_count": 0, "first_reply_created_at": null, "priority": null, "waiting_since": 1768967324, "conversation_category": "chat", "chat_mode": "private_chat", "ticket_info": null, "agent_last_seen_at": 0, "contact_last_seen_at": 0, "last_activity_at": 1768967324, "timestamp": 1768967324, "created_at": 1768967324, "updated_at": 1768967324.268219, "event": "conversation_created" }
              
              {
  "account": {
    "id": 17629000001207,
    "name": "1112"
  },
  "additional_attributes": {},
  "can_reply": true,
  "channel": "Channel::Api",
  "contact_inbox": {
    "id": 42213404,
    "contact_id": 42218348,
    "inbox_id": 523,
    "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588",
    "created_at": "2026-01-21T03:26:49.012Z",
    "updated_at": "2026-01-21T03:26:49.012Z",
    "hmac_verified": false,
    "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni"
  },
  "id": 89,
  "inbox_id": 523,
  "messages": [],
  "labels": [],
  "meta": {
    "sender": {
      "additional_attributes": {},
      "custom_attributes": {},
      "email": "alice@acme.inc",
      "id": 42218348,
      "identifier": null,
      "name": "Test",
      "phone_number": "+123456789",
      "thumbnail": "",
      "blocked": false,
      "type": "contact"
    },
    "assignee": null,
    "team": null,
    "hmac_verified": false,
    "channel": "Channel::Api"
  },
  "status": "open",
  "custom_attributes": {},
  "snoozed_until": null,
  "unread_count": 0,
  "first_reply_created_at": null,
  "priority": null,
  "waiting_since": 1768967324,
  "conversation_category": "chat",
  "chat_mode": "private_chat",
  "ticket_info": null,
  "agent_last_seen_at": 0,
  "contact_last_seen_at": 0,
  "last_activity_at": 1768967324,
  "timestamp": 1768967324,
  "created_at": 1768967324,
  "updated_at": 1768967324.268219,
  "event": "conversation_created"
}

            
此代碼塊在浮窗中顯示

對話建立事件參數

字段 类型 必填 描述
account Object 帳號項目資訊
id Number 項目ID
name String 項目名稱
additional_attributes Object 附加屬性
can_reply Boolean 是否可以回覆
channel String 通道類型,eg:api,email等
contact_inbox Object 聯繫人資訊
id Number contact_inbox表id,記錄聯繫人與通道的關係
contact_id Number 聯繫人ID
inbox_id Number 通道id
source_id String 會話來源ID,如Telegram的user_id
created_at String 建立時間
updated_at String 更新時間
hmac_verified Boolean HMAC驗證狀態
pubsub_token String 發布訂閱令牌
id Number 對話ID
inbox_id Number 通道ID
messages Array 訊息列表
labels Array 標籤列表
meta Object 元資訊
sender Object 發送者資訊
additional_attributes Object 發送者附加屬性
custom_attributes Object 發送者自訂屬性
email String 發送者郵箱
id Number 發送者在liveDesk的內部ID
identifier String 發送者標識符
name String 發送者名稱
phone_number String 發送者電話號碼
thumbnail String 發送者頭像
blocked Boolean 發送者是否被鎖定
type String 發送者類型
assignee Object 分配客服代理資訊
team Object 分配客服團隊資訊
hmac_verified Boolean HMAC驗證狀態
channel String 通道類型
status String 对话状态,比如open,closed等
custom_attributes Object 自訂屬性
snoozed_until String 暫停直到某個時間點為止
unread_count Number 未讀訊息數
first_reply_created_at String 首次回覆建立時間
priority String 優先級
waiting_since Number 等待開始時間
conversation_category String 對話類別,例如ticket、chat
chat_mode String 聊天模式
ticket_info Object 工單資訊
agent_last_seen_at Number 客服最後查看時間
contact_last_seen_at Number 聯繫人最後查看時間
last_activity_at Number 最後活動時間
timestamp Number 時間戳
created_at Number 建立時間
updated_at Number 更新時間
event String 事件類型

對話更新

當對話中的任何屬性更新時,將觸發該事件。

{ "event": "conversation_updated", "changed_attributes": [ { "updated_at": { "previous_value": "2026-01-21T04:04:56.548Z", "current_value": "2026-01-21T04:04:56.601Z" } }, { "first_reply_created_at": { "previous_value": null, "current_value": "2026-01-21T04:04:56.544Z" } }, { "waiting_since": { "previous_value": "2026-01-21T03:48:44.268Z", "current_value": null } } ] // <...Conversation Attributes> 對話屬性內容 }
              
              {
  "event": "conversation_updated",
  "changed_attributes": [
    {
      "updated_at": {
        "previous_value": "2026-01-21T04:04:56.548Z",
        "current_value": "2026-01-21T04:04:56.601Z"
      }
    },
    {
      "first_reply_created_at": {
        "previous_value": null,
        "current_value": "2026-01-21T04:04:56.544Z"
      }
    },
    {
      "waiting_since": {
        "previous_value": "2026-01-21T03:48:44.268Z",
        "current_value": null
      }
    }
  ]
  // <...Conversation Attributes> 對話屬性內容
}

            
此代碼塊在浮窗中顯示

對話更新事件參數

字段 类型 必填 描述
event String 事件類型
changed_attributes Array 變更屬性列表
field_name Object 變更的欄位名稱
previous_value string 變更前的值
current_value string 變更後的值

對話狀態變更

當對話狀態發生變化時,將觸發此事件。

{ "event": "conversation_status_changed" // <...Conversation Attributes> 對話屬性內容 }
              
              {
  "event": "conversation_status_changed"
  // <...Conversation Attributes> 對話屬性內容
}

            
此代碼塊在浮窗中顯示

訊息建立

當使用者或者客服傳送訊息,將觸發該事件。

{ "account": { "id": 17629000001207, "name": "1112" }, "additional_attributes": {}, "content_attributes": {}, "content_type": "text", "content": "你好請問有什麼問題", "conversation": { "account": { "id": 17629000001207, "name": "1112" }, "additional_attributes": {}, "can_reply": true, "channel": "Channel::Api", "contact_inbox": { "id": 42213404, "contact_id": 42218348, "inbox_id": 523, "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588", "created_at": "2026-01-21T03:26:49.012Z", "updated_at": "2026-01-21T03:26:49.012Z", "hmac_verified": false, "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni" }, "id": 89, "inbox_id": 523, "messages": [ { "id": 2187685, "content": "你好請問有什麼問題", "account_id": 17629000001207, "inbox_id": 523, "conversation_id": 89, "message_type": 1, "created_at": 1768968296, "updated_at": "2026-01-21T04:04:56.544Z", "private": false, "status": "sent", "source_id": null, "content_type": "text", "content_attributes": {}, "sender_type": "User", "sender_id": 41, "external_source_ids": {}, "additional_attributes": {}, "processed_message_content": "你好請問有什麼問題", "sentiment": {}, "sorting_id": null, "original_message_id": null, "conversation_topic_id": null, "topic_id": null, "conversation": { "assignee_id": null, "unread_count": 0, "last_activity_at": 1768968296, "contact_inbox": { "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588" } }, "sender": { "id": 41, "name": "support", "available_name": "support", "avatar_url": "", "type": "user", "availability_status": null, "thumbnail": "" } } ], "labels": [], "meta": { "sender": { "additional_attributes": {}, "custom_attributes": {}, "email": "alice@acme.inc", "id": 42218348, "identifier": null, "name": "Test", "phone_number": "+123456789", "thumbnail": "", "blocked": false, "type": "contact" }, "assignee": null, "team": null, "hmac_verified": false, "channel": "Channel::Api" }, "status": "open", "custom_attributes": {}, "snoozed_until": null, "unread_count": 0, "first_reply_created_at": null, "priority": null, "waiting_since": 1768967324, "conversation_category": "chat", "chat_mode": "private_chat", "ticket_info": null, "agent_last_seen_at": 0, "contact_last_seen_at": 0, "last_activity_at": 1768968296, "timestamp": 1768968296, "created_at": 1768967324, "updated_at": 1768968296.5483441 }, "created_at": "2026-01-21T04:04:56.544Z", "id": 2187685, "inbox": { "id": 523, "name": "Test01" }, "message_type": "outgoing", "conversation_topic_id": null, "private": false, "sender": { "id": 41, "name": "support", "email": "support@jiguang.cn", "type": "user", "availability": "online" }, "source_id": null, "user_id": 42213404, "contact_id": 42218348, "participants": null, "event": "message_created" }
              
              {
  "account": {
    "id": 17629000001207,
    "name": "1112"
  },
  "additional_attributes": {},
  "content_attributes": {},
  "content_type": "text",
  "content": "你好請問有什麼問題",
  "conversation": {
    "account": {
      "id": 17629000001207,
      "name": "1112"
    },
    "additional_attributes": {},
    "can_reply": true,
    "channel": "Channel::Api",
    "contact_inbox": {
      "id": 42213404,
      "contact_id": 42218348,
      "inbox_id": 523,
      "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588",
      "created_at": "2026-01-21T03:26:49.012Z",
      "updated_at": "2026-01-21T03:26:49.012Z",
      "hmac_verified": false,
      "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni"
    },
    "id": 89,
    "inbox_id": 523,
    "messages": [
      {
        "id": 2187685,
        "content": "你好請問有什麼問題",
        "account_id": 17629000001207,
        "inbox_id": 523,
        "conversation_id": 89,
        "message_type": 1,
        "created_at": 1768968296,
        "updated_at": "2026-01-21T04:04:56.544Z",
        "private": false,
        "status": "sent",
        "source_id": null,
        "content_type": "text",
        "content_attributes": {},
        "sender_type": "User",
        "sender_id": 41,
        "external_source_ids": {},
        "additional_attributes": {},
        "processed_message_content": "你好請問有什麼問題",
        "sentiment": {},
        "sorting_id": null,
        "original_message_id": null,
        "conversation_topic_id": null,
        "topic_id": null,
        "conversation": {
          "assignee_id": null,
          "unread_count": 0,
          "last_activity_at": 1768968296,
          "contact_inbox": {
            "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588"
          }
        },
        "sender": {
          "id": 41,
          "name": "support",
          "available_name": "support",
          "avatar_url": "",
          "type": "user",
          "availability_status": null,
          "thumbnail": ""
        }
      }
    ],
    "labels": [],
    "meta": {
      "sender": {
        "additional_attributes": {},
        "custom_attributes": {},
        "email": "alice@acme.inc",
        "id": 42218348,
        "identifier": null,
        "name": "Test",
        "phone_number": "+123456789",
        "thumbnail": "",
        "blocked": false,
        "type": "contact"
      },
      "assignee": null,
      "team": null,
      "hmac_verified": false,
      "channel": "Channel::Api"
    },
    "status": "open",
    "custom_attributes": {},
    "snoozed_until": null,
    "unread_count": 0,
    "first_reply_created_at": null,
    "priority": null,
    "waiting_since": 1768967324,
    "conversation_category": "chat",
    "chat_mode": "private_chat",
    "ticket_info": null,
    "agent_last_seen_at": 0,
    "contact_last_seen_at": 0,
    "last_activity_at": 1768968296,
    "timestamp": 1768968296,
    "created_at": 1768967324,
    "updated_at": 1768968296.5483441
  },
  "created_at": "2026-01-21T04:04:56.544Z",
  "id": 2187685,
  "inbox": {
    "id": 523,
    "name": "Test01"
  },
  "message_type": "outgoing",
  "conversation_topic_id": null,
  "private": false,
  "sender": {
    "id": 41,
    "name": "support",
    "email": "support@jiguang.cn",
    "type": "user",
    "availability": "online"
  },
  "source_id": null,
  "user_id": 42213404,
  "contact_id": 42218348,
  "participants": null,
  "event": "message_created"
}

            
此代碼塊在浮窗中顯示

訊息建立事件參數

字段 类型 必填 描述
account Object 帳戶資訊
id Number 項目ID
name String 項目名稱
additional_attributes Object 附加屬性
content_attributes Object 內容屬性
content_type String 內容類型
content String 訊息內容
conversation Object 對話資訊
created_at String 建立時間
id Number 訊息ID
inbox Object 通道資訊
id Number 通道ID
name String 通道名稱
message_type String 訊息類型
conversation_topic_id String 對話主題ID
private Boolean 是否私有
sender Object 發送者資訊
id Number 發送者ID
name String 發送者名稱
email String 發送者郵箱
type String 發送者類型
availability String 發送者可用狀態
source_id String 來源ID
participants Object 參與者資訊
event String 事件類型

訊息更新

當對話中的訊息內容更新時,將觸發該事件。

{ "event": "message_updated" // <...Message Attributes> 訊息屬性內容 }
              
              {
  "event": "message_updated"
  // <...Message Attributes> 訊息屬性內容
}

            
此代碼塊在浮窗中顯示
icon
聯繫銷售