Forward the message to WeChat customer service
If the official account is in development mode, when an ordinary WeChat user sends a message to the official account, the WeChat server will first POST the message to the URL filled in by the developer. If you want to forward the message to For the customer service system, the developer needs to return a message with MsgType of transfer_customer_service in the response package. After receiving the response, the WeChat server will forward the message sent to the customer service system. You can also attach TransInfo information in XML to assign it to a customer service account when returning the transfer_customer_service message.
After the user is accessed by the customer service, before the customer service closes the session, and during the session, the messages sent by the user will be directly forwarded to the customer service system. When the session is not closed by customer service for more than 30 minutes, the WeChat server will automatically stop forwarding to customer service and resume sending the message to the URL filled in by the developer.
When the user is waiting in the queue, the message sent by the user will still be pushed to the URL filled in by the developer.
It is important to note here that only messages sent by WeChat users are forwarded, and any other events (such as menu clicks, geographical location reporting, etc.) should not be forwarded. Otherwise, customer service will see some meaningless messages on the customer service system.
Forward the message to customer service
#If the official account is in development mode, when ordinary WeChat users send messages to the official account, the WeChat server will first The message is POSTed to the URL filled in by the developer. If you want to forward the message to the customer service system, the developer needs to return a message with MsgType of transfer_customer_service in the response package. After receiving the response, the WeChat server will forward the message sent to the customer service. system.
<xml> <ToUserName><![CDATA[touser]]></ToUserName> <FromUserName><![CDATA[fromuser]]></FromUserName> <CreateTime>1399197672</CreateTime> <MsgType><![CDATA[transfer_customer_service]]></MsgType> </xml>
Parameter Description
Parameter | Is it required | Description |
---|---|---|
ToUserName | Yes | Receiver account (received OpenID) |
FromUserName | is | Developer WeChat ID |
CreateTime | is | Message creation time (integer) |
MsgType | is | transfer_customer_service |
The message is forwarded to the designated customer service
If you have multiple customer service staff logging in to the customer service at the same time and turning on automatic During reception, when each customer's message is forwarded to customer service, the multi-customer service system will assign the customer to one of the customer service personnel. If you want to transfer a customer's message to a designated customer service, you can specify a customer service account by attaching TransInfo information when returning the transfer_customer_service message. It should be noted that if the designated customer service does not have access capabilities (not online, automatic access is not turned on, or automatic access is full), the user will be directly connected to the designated customer service, and other customer service will not be notified, and will not be contacted by other customer service Reception. It is recommended that when specifying customer service, you first check the customer service's access capability (obtain the online customer service reception information interface), and designate a customer service who has the ability to access to ensure that customers can receive services in a timely manner.
Sample code
<xml> <ToUserName><![CDATA[touser]]></ToUserName> <FromUserName><![CDATA[fromuser]]></FromUserName> <CreateTime>1399197672</CreateTime> <MsgType><![CDATA[transfer_customer_service]]></MsgType> <TransInfo> <KfAccount><![CDATA[test1@test]]></KfAccount> </TransInfo> </xml>
Parameter description
Parameter | Is it required | Description |
---|---|---|
ToUserName | Yes | Receiver account (received OpenID) |
FromUserName | is | Developer WeChat ID |
CreateTime | is | Message creation time (integer) |
MsgType | is | transfer_customer_service |
KfAccount | is the customer service account for | specified session access |