Webhook Events

การสร้างการสนทนา

เมื่อผู้ใช้สร้างการสนทนาใหม่สำเร็จโดยการเรียก API ที่อยู่ webhook ที่กำหนดค่าให้กับช่อง API จะได้รับเหตุการณ์ callback การสร้างการสนทนา

{ "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 No ข้อมูลโปรเจกต์ของบัญชี
id Number No ID โปรเจกต์
name String No ชื่อโปรเจกต์
additional_attributes Object No แอตทริบิวต์เพิ่มเติม
can_reply Boolean No ไม่ว่าจะสามารถตอบได้หรือไม่
channel String No ประเภทช่องทาง เช่น api, email ฯลฯ
contact_inbox Object No ข้อมูลผู้ติดต่อ
id Number No contact_inbox table id, บันทึกความสัมพันธ์ระหว่างผู้ติดต่อและช่องทาง
contact_id Number No ID ผู้ติดต่อ
inbox_id Number No ID ช่องทาง
source_id String No Conversation source ID, เช่น user_id ของ Telegram
created_at String No เวลาสร้าง
updated_at String No เวลาอัปเดต
hmac_verified Boolean No สถานะการตรวจสอบ HMAC
pubsub_token String No Publish-subscribe token
id Number No ID การสนทนา
inbox_id Number No ID ช่องทาง
messages Array No รายการข้อความ
labels Array No รายการป้ายกำกับ
meta Object No ข้อมูลเมต้า
sender Object No ข้อมูลผู้ส่ง
additional_attributes Object No แอตทริบิวต์เพิ่มเติมของผู้ส่ง
custom_attributes Object No แอตทริบิวต์แบบกำหนดเองของผู้ส่ง
email String No อีเมลของผู้ส่ง
id Number No ID ภายในของผู้ส่งใน liveDesk
identifier String No ตัวระบุผู้ส่ง
name String No ชื่อผู้ส่ง
phone_number String No เบอร์โทรศัพท์ของผู้ส่ง
thumbnail String No รูปถ่ายของผู้ส่ง
blocked Boolean No ไม่ว่าผู้ส่งจะถูกบล็อกหรือไม่
type String No ประเภทผู้ส่ง
assignee Object No ข้อมูลตัวแทนบริการลูกค้าที่ถูกกำหนด
team Object No ข้อมูลทีมบริการลูกค้าที่ถูกกำหนด
hmac_verified Boolean No สถานะการตรวจสอบ HMAC
channel String No ประเภทช่องทาง
status String No สถานะการสนทนา เช่น open, closed ฯลฯ
custom_attributes Object No แอตทริบิวต์แบบกำหนดเอง
snoozed_until String No หยุดชั่วคราวจนถึงเวลาที่กำหนด
unread_count Number No จำนวนข้อความที่ยังไม่ได้อ่าน
first_reply_created_at String No เวลาสร้างการตอบสนองครั้งแรก
priority String No ความสำคัญ
waiting_since Number No เวลาเริ่มรอ
conversation_category String No หมวดหมู่การสนทนา
chat_mode String No โหมดแชท
ticket_info Object No ข้อมูลตั๋ว
agent_last_seen_at Number No เวลาที่ตัวแทนเห็นครั้งล่าสุด
contact_last_seen_at Number No เวลาที่ผู้ติดต่อเห็นครั้งล่าสุด
last_activity_at Number No เวลากิจกรรมล่าสุด
timestamp Number No เวลา
created_at Number No เวลาสร้าง
updated_at Number No เวลาอัปเดต
event String No ประเภทเหตุการณ์

การอัปเดตการสนทนา

เหตุการณ์นี้จะถูกทริกเกิดเมื่อคุณลักษณะใดๆ ในการสนทนาถูกอัปเดต

{ "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 No ข้อมูลบัญชี
id Number No ID โปรเจกต์
name String No ชื่อโปรเจกต์
additional_attributes Object No แอตทริบิวต์เพิ่มเติม
content_attributes Object No แอตทริบิวต์ของเนื้อหา
content_type String No ประเภทเนื้อหา
content String No เนื้อหาข้อความ
conversation Object No ข้อมูลการสนทนา
created_at String No เวลาสร้าง
id Number No ID ข้อความ
inbox Object No ข้อมูลช่องทาง
id Number No ID ช่องทาง
name String No ชื่อช่องทาง
message_type String No ประเภทข้อความ
conversation_topic_id String No ID หัวข้อการสนทนา
private Boolean No ไม่ว่าเป็นส่วนตัวหรือไม่
sender Object No ข้อมูลผู้ส่ง
id Number No ID ผู้ส่ง
name String No ชื่อผู้ส่ง
email String No อีเมลของผู้ส่ง
type String No ประเภทผู้ส่ง
availability String No สถานะความพร้อมของผู้ส่ง
source_id String No ID แหล่งที่มา
participants Object No ข้อมูลผู้เข้าร่วม
event String No ประเภทเหตุการณ์

การอัปเดตข้อความ

เหตุการณ์นี้จะถูกทริกเกิดเมื่อเนื้อหาข้อความในการสนทนาถูกอัปเดต

{ "event": "message_updated" // <...Message Attributes> เนื้อหาคุณลักษณะของข้อความ }
              
              {
  "event": "message_updated"
  // <...Message Attributes> เนื้อหาคุณลักษณะของข้อความ
}

            
โค้ดนี้โชว์เป็นหน้าต่างลอย
icon
ติดต่อฝ่ายขาย