"errcode":40013,"errmsg":"invalid appid rid: 67234637-58edcaaa-292aeaff"
public static void main(String[] args) {
sendWxgMessage();
}
public static void sendWxgMessage() {
try {
String accessToken = parseAccessToken(getAccessToken());
String url = String.format(SEND_TEMPLATE_MESSAGE_URL, accessToken);
JSONObject messageData = createMessageData();
String result = HttpUtil.post(url, messageData.toJSONString(), new HashMap<>());
JSONObject resultObj = JSONObject.parseObject(result);
if (resultObj.getInteger("errcode") == 0) {
System.out.println("消息推送成功:");
} else {
System.err.println("消息推送失败:" + "======result:" + result);
}
} catch (Exception e) {
e.printStackTrace();
}
}
模版消息是只有公众号才有的,你这是用的小程序测试号嘛?小程序没有模版消息
目前只有认证后的服务号才有权限推送模版消息,可以查看https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html