快工助手跨境电商知识与商机助手

(14) New message

TikTok Shop 官方资料 · TikTok Shop Partner Center 开发者文档 · 适合开发者

stable本次发布有变化全部展示

来自 TikTok Shop 官方资料快照 ·

打开官方原文 ↗
  1. 当前资料结构化阅读页
  2. 固定快照已留存,可追溯
  3. 官方原文可核对
查看技术与溯源信息
平台 / profile
TikTok Shop / profile.tiktok.docs_api
语言
en-US
发布版本
cn-20260909-2
标签
zhuge/sourceplatform/tiktok_shopaudience/developercategory/api_doctopic/compliancetopic/developer

资料正文

§1 1. Trigger scenario

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

#

§2 2. Data business parameters

Parameter nameData typeSampleDescription
message_idstring7494560109732334263The identification of the message
indexstring7494560109732334274The message index that can be used to sort messages. Newer messages have a larger index.
conversation_idstring576486316948490001The identification of the conversation
typestring(enum)TEXTMessage 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
contentstring{"content": "simple text message"}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"}
create_timeint1691411573Message creation time, represented as a Unix timestamp (seconds).
is_visiblebooltrueWhether this message should be displayed to customer service.
senderObjectThe message sender. For system and robot roles, the shop is the sender.
^im_user_idstring7494560109732334261Sender's ID These are IM IDs, and can not be used to query orders.
^rolestring(enum)BUYERSender's role, with possible values: * BUYER * SHOP * CUSTOMER_SERVICE * SYSTEM * ROBOT
#

§3 Event example

Event 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"
    }
  }
}
#