Forwarding Customer Service Messages
If the push notification is configured for a Mini Program, when a Weixin user sends messages to the Mini Program's customer service, the Weixin server will first POST the messages to the URL configured by the developer. If the messages are intended to be forwarded to online version of the customer service tool, the developer must return messages with MsgType as transfer_customer_service in the response package. After receiving the response, the Weixin server forwards the messages sent in that session to the customer service system.
When the user is connected to the customer service, before the customer service closes the session, messages sent by the user in the session are directly forwarded to the customer service system. When the session is not closed by the customer service after 30 minutes, the Weixin server will automatically stop forwarding messages to the customer service, and the messages will be sent to the URL configured by the developer.
When the user is waiting in queue, the messages sent by the user will still be pushed to the URL configured by the developer.
Note that, only messages sent by Weixin users will be forwarded, other events (e.g. the user starts a customer service session from the Mini Program) should not be forwarded; otherwise, the customer service will see meaningless messages on the customer service system.
Forwarding Messages to the Online Version of Customer Service Tool
The developer only returns messages with MsgType as transfer_customer_service in the response package. The Weixin server forwards the messages sent in that session to the customer service system after receiving the response.
<xml> <ToUserName><![CDATA[touser]]></ToUserName> <FromUserName><![CDATA[fromuser]]></FromUserName> <CreateTime>1399197672</CreateTime> <MsgType><![CDATA[transfer_customer_service]]></MsgType> </xml>
|ToUserName||Yes||Recipent's ID (OpenID received)|
|FromUserName||Yes||Developer's Weixin ID|
|CreateTime||Yes||Creation time of the message (integral)|