The new message webhook is triggered when a new message is sent in a customer service conversation.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The ID of the webhook type.
The ID of the notification.
The shop ID.
The Unix timestamp when the webhook was triggered.
object
The identification of the message
The message index that can be used to sort messages. Newer messages have a larger index.
The identification of the conversation
Message type, with possible values:
- TEXT
- IMAGE
- ALLOCATED_SERVICE
- NOTIFICATION
- BUYER_ENTER_FROM_TRANSFER
- BUYER_ENTER_FROM_PRODUCT
- BUYER_ENTER_FROM_ORDER
- PRODUCT_CARD
- ORDER_CARD
- EMOTICONS
- VIDEO
- COUPON_CARD *LOGISTICS_CARD
- OTHER
Message content, in JSON serialized string. Examples:
-
TEXT: {“content”: “simple text”}
-
IMAGE: {
“height”: “290”,
“url”: “https://tosv.boei18n.byted.org/obj/temai-im/FszkJ53nSapYG6KDaJQmqR3jjoZGwww304-290”,
“width”: “304”
} -
PRODUCT_CARD, BUYER_ENTER_FROM_PRODUCT: {“product_id”: “12345”}
-
ORDER_CARD, BUYER_ENTER_FROM_ORDER : {“order_id”: “12345”}
-
VIDEO: {
“url”: “https://video-boei18n.byted.org/storage/v1/tos-boei18n-v-c72c01/e8240f35244646428df9c3244d1a7408?x-tos-algorithm=v2&x-tos-authkey=5bf25627da095a5cba28ace592de46cc&x-tos-expires=1681980481&x-tos-signature=r_bRxtrvGhXAuZgMmNhlZ_Upqzg”,
“cover”: “https://p-boei18n.byted.org/tos-boei18n-v-c72c01/o8keEOhzTcNCcJyAbkWZwpLIyTfkJxcGbRBvLP~tplv-jvtte31kaf-origin-jpeg.jpeg?”,
“width”: 640,
“height”: 360,
“duration”: “20.504”,
“vid”: “v0e30cg700f7cgcmu8jc77u9e2bdp95g”,
“expire_time”: “1681980481”,
“format”: “mp4”,
“size”: 400000,
“bit_rate”: 156067,
“quality”: “original”,
“codec_type”: “h264”
} -
LOGISTICS_CARD: { “order_id”: “580874485811283206”, “package_id”: “123456” // Optional (recommended for one order with multiple packages; not required for one order with one package) }
-
COUPON_CARD: {“coupon_id”: “7262992004278206762”}
Note: Use Get Coupon for the details of the coupon.
- ALLOCATED_SERVICE, NOTIFICATION, BUYER_ENTER_FROM_TRANSFER, OTHER: {“content”: “simple text”}
Message creation time, represented as a Unix timestamp (seconds).
Whether this message should be displayed to customer service.
The message sender. For system and robot roles, the shop is the sender.
object
Sender’s ID These are IM IDs, and can not be used to query orders.
Sender’s role, with possible values:
- BUYER
- SHOP
- CUSTOMER_SERVICE
- SYSTEM
- ROBOT
Example
{ "type": 14, "tts_notification_id": "7327112393057371910", "shop_id": "7494049642642441621", "timestamp": 1644412885, "data": { "content": "{\"content\":\"444\"}", "conversation_id": "710688832392260838", "create_time": 1681790246, "is_visible": true, "message_id": "722323407926368819", "index": "7494560109732334274", "type": "TEXT", "sender": { "im_user_id": "707885565181165594", "role": "BUYER" } }}Responses
Section titled “Responses”Return HTTP 200 to acknowledge receipt.