客服消息转发到网页版客服工具没反应
开发者只在响应包中返回 MsgType 为 transfer_customer_service 的消息,微信服务器收到响应后就会把当次发送的消息转发至客服系统。
{“ToUserName”:“o4SqQ4gknu57-Za3uxN_noUi5Yl4”,“FromUserName”:“打码”,“CreateTime”:1554974253,“MsgType”:“transfer_customer_service”}
设置了这个还是不行
4 回复
推送消息那里设置的JSON就要返回JOSN格式的,设置的XML就要返回XML格式的
KfMessage kfMessage = new KfMessage(); kfMessage.setToUserName(messageJson.getString( "FromUserName" )); kfMessage.setFromUserName(messageJson.getString( "ToUserName" )); kfMessage.setCreateTime(messageJson.getLong( "CreateTime" )); kfMessage.setMsgType( "transfer_customer_service" ); public class KfMessage { [@JsonProperty](/user/JsonProperty) ( "ToUserName" ) private String toUserName; [@JsonProperty](/user/JsonProperty) ( "FromUserName" ) private String fromUserName; [@JsonProperty](/user/JsonProperty) ( "CreateTime" ) private long createTime; [@JsonProperty](/user/JsonProperty) ( "MsgType" ) private String msgType; public String getToUserName() { return toUserName; } public void setToUserName(String toUserName) { this .toUserName = toUserName; } public String getFromUserName() { return fromUserName; } public void setFromUserName(String fromUserName) { this .fromUserName = fromUserName; } public long getCreateTime() { return createTime; } public void setCreateTime( long createTime) { this .createTime = createTime; } public String getMsgType() { return msgType; } public void setMsgType(String msgType) { this .msgType = msgType; } } kfMessage.setCreateTime(messageJson.getLong( "CreateTime" )); kfMessage.setMsgType( "transfer_customer_service" ); |
然后controller返回kfMessage就好了