Skip to content

(14) New message

POST

The new message webhook is triggered when a new message is sent in a customer service conversation.

Media typeapplication/json
object
type
required

The ID of the webhook type.

integer
Allowed value: 14
tts_notification_id

The ID of the notification.

string
shop_id

The shop ID.

string
timestamp

The Unix timestamp when the webhook was triggered.

integer format: int64
data
object
message_id

The identification of the message

string
index

The message index that can be used to sort messages. Newer messages have a larger index.

string
conversation_id

The identification of the conversation

string
type

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
string
Allowed 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
content

Message content, in JSON serialized string. Examples:

Note: Use Get Coupon for the details of the coupon.

  • ALLOCATED_SERVICE, NOTIFICATION, BUYER_ENTER_FROM_TRANSFER, OTHER: {“content”: “simple text”}
string
create_time

Message creation time, represented as a Unix timestamp (seconds).

integer format: int64
is_visible

Whether this message should be displayed to customer service.

boolean
sender

The message sender. For system and robot roles, the shop is the sender.

object
im_user_id

Sender’s ID These are IM IDs, and can not be used to query orders.

string
role

Sender’s role, with possible values:

  • BUYER
  • SHOP
  • CUSTOMER_SERVICE
  • SYSTEM
  • ROBOT
string
Allowed 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"
}
}
}

Return HTTP 200 to acknowledge receipt.