- 调用公众号群发接口,报40008错误,参数的格式和官方文档是一样的
调用公众号群发接口,报40008错误,参数的格式和官方文档是一样的 {"filter":{"is_to_all":true},"mpnews":{"media_id":"dguVkLqFd-SyvBevNQPVDWYVgW0DJcEt7IPzZ7Hmfg3xOguXhAhesGnQgL4617Ek"},"send_ignore_reprint":0,"msgtype":"mpnews"} String accessToken = null; if(getAccessToken()!=null){ accessToken=getAccessToken(); } boolean b = true; String url=" https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token="+accessToken; JSONObject jsonObject=new JSONObject(); JSONObject filter=new JSONObject(); filter.put("is_to_all",b); JSONObject mpnews=new JSONObject(); mpnews.put("media_id",mediaId); jsonObject.put("filter",filter); jsonObject.put("mpnews",mpnews); jsonObject.put("send_ignore_reprint",0); jsonObject.put("msgtype","mpnews"); System.out.println(jsonObject); String response=HttpUtil.post(url,jsonObject); JSONObject jsonObject2=JSONObject.parseObject(response); Long msg_data_id= (Long) jsonObject2.get("publish_status");
2022-07-26 - 调用群发接口,报错40008,参数的格式和官方文档是一样的,求解?
String url=" https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token="+accessToken; JSONObject jsonObject=new JSONObject(); JSONObject filter=new JSONObject(); filter.put("is_to_all",b); JSONObject mpnews=new JSONObject(); mpnews.put("media_id",mediaId); jsonObject.put("filter",filter); jsonObject.put("mpnews",mpnews); jsonObject.put("send_ignore_reprint",0); jsonObject.put("msgtype","mpnews"); System.out.println(jsonObject); String response=HttpUtil.post(url,jsonObject); JSONObject jsonObject2=JSONObject.parseObject(response); Long msg_data_id= (Long) jsonObject2.get("publish_status");
2022-07-25