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

webchat_push

Shopee 官方资料 · Shopee Open Platform 推送机制(Push Mechanism) · 适合开发者

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

来自 Shopee 官方资料快照 ·

打开官方原文 ↗
  1. 当前资料结构化阅读页
  2. 固定快照已留存,可追溯
  3. 官方原文可核对
查看技术与溯源信息
平台 / profile
Shopee / profile.shopee.push_mechanism
语言
en-US
发布版本
cn-20260909-2
标签
zhuge/sourceplatform/shopeeaudience/developercategory/api_doctopic/apitopic/developertopic/pushtopic/webchat-push

资料正文

§1 webchat_push

Get the chat message

#

§2 Overview

Overview

FieldValue
Push code10
Timeout (seconds)2
Retry strategy (seconds)1, 2, 3
Guaranteed deliveryYes
#

§3 Push parameters

Push parameters

NameTypeRequiredSampleDescription
dataobject
data.typestringCan be notification / message
data.regionstringThe region info.
data.contentobjectThe detailed message.
data.content.user_idstringReturned when the type = notification.
data.content.conversation_idstringShopee's unique identifier for a conversation.
data.content.typestringReturned when the type = notification.
data.content.timestamptimestampReturned when the type = notification.
data.content.msg_idint64Returned when the type = notification.
data.content.biz_idint64Returned when the type = notification.
data.content.message_idstringReturned when type= message. Shopee's unique identifier for a message.
data.content.shop_idint64Returned when type= message. The shop_id of the shop message sent to (to_shop_id)
data.content.request_idstringReturned when type= message. The identifier for an request for error tracking.
data.content.from_user_namestringReturned when type= message. The user name for the message sender in the conversation.
data.content.from_idint64The user id for the message sender in the conversation.
data.content.to_idint64Returned when type= message. The user id for the message recipient in the conversation.
data.content.to_user_namestringReturned when type= message. The user name for the message recipient in the conversation.
data.content.message_typestringReturned when type= message. text / video / image / item / faq_liveagent
data.content.contentobject
data.content.content.texttimestampReturned when message type=text or faq_liveagent, specific dialog text information.
data.content.content.translationobjectReturned when message type=text.
data.content.content.translation.textstring
data.content.content.translation.sourcestring
data.content.content.translation.target_languagestring
data.content.content.translation.source_languagestring
data.content.content.midobjectReturned when message type=text.
data.content.content.mid.textstring
data.content.content.mid.sourcestring
data.content.content.mid.target_languagestring
data.content.content.mid.source_languagestring
data.content.content.urlstringReturned when message type=image.
data.content.content.thumb_urlstringReturned when message type=image or video.
data.content.content.thumb_heightint64Returned when message type=image or video.
data.content.content.thumb_widthint64Returned when message type=image or video.
data.content.content.file_server_idint64Returned when message type=image.
data.content.content.video_urlstringReturned when message type=video.
data.content.content.duration_secondsint64Returned when message type=video.
data.content.content.shop_idint64Returned when message type=item. The shop_id of the shop message sent to (to_shop_id)
data.content.content.item_idint64Returned when message type=item.
data.content.content.pass_through_datastringReturned when message type=faq_liveagent.
data.content.content.messagesstring[]["23234234234","234232423"]Returned when type=bundle_message. return all the message_id in the bundle_message
data.content.content.shopee_chatbot_repliedbooleantrueReturn when message_type=bundle_message if there is Shopee Chatbot session in the bundle message; We recommend transfer to manual reply mode if shopee_chatbot_replied=true(Shopee Chatbot already involved)
data.content.created_timestamptimestampReturned when type= message. The creation time of conversation.
data.content.regionstringReturned when type= message. The region where the conversation take places.
data.content.is_in_chatbot_sessionbooleanReturned when type= message.
data.content.source_contentobjectReturned when type= message.
data.content.source_content.item_idintReturned when message type= item.
data.content.sub_account_idint64if the message is sent from sub-account/main account, then will indicate the sub_account_id; If not, =0
data.content.sub_account_namestringif the message is sent from sub-account/main account, then will indicate the sub_account_id; If not, =0
data.content.quoted_msgobject[]
data.content.quoted_msg.message_idint64Return message_id when a quoted message is present.; If there is no quoted message, message_id will be empty.
data.content.business_typeint32business_type=0 means it is a conversation chat between buyer and seller; business_type=11 means it is a conversation chat between affiliate and seller
data.content.to_shop_idint64shopee shop id who receive the message; <path></path>
data.content.from_shop_idint64shopee shop id who send the message
data.content.statusstringThe message status, the possible values are: normal; auto_reply; blocked; user_chat; web_chat; censored_whitelist; censored_blacklist; offwork_autoreply
shop_idintshop_id of shop receives the push message; Shopee's unique identifier for a shop.
codeintShopee's unique identifier for a push notification.
timestamptimestampTimestamp that indicates the message was sent.
#

§4 Sample

Sample

{
"msg_id": null,
"data": {
"type": "notification",
"region": "PH",
"content": {
"user_id": 12252079,
"conversation_id": "4670954831706433",
"type": "mark_as_replied",
"content": {
"conversation_id": "4670954310906433"
},
"timestamp": 1719883961,
"msg_id": 0,
"biz_id": 0,
"from_id": 0
}
{"msg_id":"","data":{"type":"message","region":"ID","content":{"message_id":"2302748948493123953","shop_id":165103149,"request_id":"35f9478b-7482-46eb-a268-8f828fedb673","from_id":165105353,"from_user_name":"vn_cstoreponorogo","to_id":947151379,"to_user_name":"keelatofficial","message_type":"text","content":{"text":"Baik kak .. 🤗"},"conversation_id":"709122092476686867","created_timestamp":1726044721,"region":"ID","is_in_chatbot_session":false,"source_content":{},"quoted_msg":{"message_id":""},"sub_account_id":0,"sub_account_name":0}},"shop_id":947042923,"code":10,"timestamp":1726044722}
{"data":{"type":"message","region":"VN","content":{"message_id":"2165920666211451249","shop_id":123456789,"request_id":"1091617252119662617","from_id":161057467,"from_user_name":"hyhy2606","to_id":213245905,"to_user_name":"sixhd.vn","message_type":"video","content":{"video_url":"cf03c9e1fe2c0992cdb51c3cb6eab2bd","thumb_url":"6c710d7679c9f3a9a7287250421d17d3_dynamic_tn","thumb_width":399,"thumb_height":713,"duration_seconds":15},"conversation_id":"691736553754845137","created_timestamp":1660799912,"region":"VN","is_in_chatbot_session":false,"source_content":{},"quoted_msg":{"message_id":""},"sub_account_id":0,"sub_account_name":0}},"shop_id":123456789,"code":10,"timestamp":1660799912}
{"data":{"type":"message","region":"VN","content":{"message_id":"2165920671942967665","shop_id":123456789,"request_id":"313F2D/BTMessage/p108","from_id":679422730,"from_user_name":"thutrang290402","to_id":6343861,"to_user_name":"thanhnga_hcm","message_type":"image","content":{"url":"https://cf.shopee.vn/file/09591ecdc9f1dc7bd507817797d826fe_dynamic","thumb_url":"b9591ecdc9f1dc7bd507817797d826fe_dynamic_tn","thumb_height":711,"thumb_width":400,"file_server_id":0},"conversation_id":"27246676204792586","created_timestamp":1660799915,"region":"VN","is_in_chatbot_session":false,"source_content":{},"quoted_msg":{"message_id":""},"sub_account_id":0,"sub_account_name":0}},"shop_id":123456789,"code":10,"timestamp":1660799915}
{"data":{"type":"message","region":"ID","content":{"message_id":"2165920670806327665","shop_id":123456789,"request_id":"389465101372418716","from_id":163219823,"from_user_name":"fadlyjo.","to_id":119159078,"to_user_name":"zhousijia","message_type":"item","content":{"shop_id":109157255,"item_id":9112503530},"conversation_id":"511784343194732911","created_timestamp":1660799914,"region":"ID","is_in_chatbot_session":false,"quoted_msg":{"message_id":""},"sub_account_id":0,"sub_account_name":0,"source_content":{"item_id":4112503530}}},"shop_id":123456789,"code":10,"timestamp":1660799915}
{"data":{"type":"message","region":"ID","content":{"message_id":"2165920670296736113","shop_id":123456789,"request_id":"4600339818579251427","from_id":172765311,"from_user_name":"bundhakevinabizar","to_id":94311357,"to_user_name":"madamegieofficial","message_type":"faq_liveagent","content":{"text":"Chat dengan Penjual","pass_through_data":""},"conversation_id":"405064194129145983","created_timestamp":1660799914,"region":"ID","is_in_chatbot_session":false,"quoted_msg":{"message_id":""},"sub_account_id":0,"sub_account_name":0,"source_content":{"order_sn":"220818EGS328B9"}}},"shop_id":123456789,"code":10,"timestamp":1660799915}
#

§5 Update log

Update log

DateChange
2025-04-18Add from_shop_id, to_shop_id, status
2024-11-05Add business_type for affiliate marketing solution chat Add bundle_message for FAQ and chatbot message Add shopee_chatbot_replied to indicate if Shopee Chatbot involved
2024-09-23Add sub_account_id and sub_account_name; Add quoted_message
2024-09-04Update the definition of the shop_id inside "content"
2022-09-24roll back retry config
#