我们的客服消息不能用了是被封杀了吗?或者被限制了?求官方给个回复。
服务器发客服消息返回码一直是-1。具体代码如下
Type type = new TypeToken<Map<String, String>>() { }.getType(); Map<String, String> bodyMap = gson.fromJson(body, type); String openId = bodyMap.get( "FromUserName" ); // 用户的openid String msgType = bodyMap.get( "MsgType" ); String event = bodyMap.get( "Event" ); if ( "text" .equals(msgType)) { HttpHeaders headers = new HttpHeaders(); // 发送图片消息之前,要把素材图片上传到微信服务器,返回media_id才能发送 // 获取该小程序的access_token String accessToken = redisTemplate.opsForValue().get( "program:recommend:access_token" ); String url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + accessToken; String p = "{ \"touser\":\"OPENID\", \"msgtype\":\"image\", \"image\": { \"media_id\":\"MEDIA_ID\" } }" ; String param = p.replace( "OPENID" , openId).replace( "MEDIA_ID" , "固定MEDIA_ID" ); RestTemplate restTemplate = new RestTemplate(); MediaType mediaType = MediaType.parseMediaType( "application/json; charset=UTF-8" ); headers.setContentType(mediaType); headers.add( "Accept" , MediaType.APPLICATION_JSON.toString()); HttpEntity<String> formEntity = new HttpEntity<String>(param, headers); ResponseEntity<String> entity = restTemplate.postForEntity(url, formEntity, String. class ); |
下图新用户的客服消息
你好,此类问题之前反馈蛮多的,都是开发者代码上的问题,请自行检查下哈
客服消息故障
https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=000802533684b89686e65809d5e400&highline=%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%AF%A5%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%8F%90%E4%BE%9B%E7%9A%84%E6%9C%8D%E5%8A%A1%E5%87%BA%E7%8E%B0%E6%95%85%E9%9A%9C%20%E8%AF%B7%E7%A8%8D%E5%90%8E%E5%86%8D%E8%AF%95%20苹果用户发消息提示,小程序回复"该小程序提供的服务出现故障,请稍后再试"
https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=00060a163944486968d6ab5af51000&highline=%E8%AF%A5%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%8F%90%E4%BE%9B%E7%9A%84%E6%9C%8D%E5%8A%A1%E5%87%BA%E7%8E%B0%E6%95%85%E9%9A%9C%2C%E8%AF%B7%E7%A8%8D%E5%90%8E%E5%86%8D%E8%AF%95