使用微信小程序开发组件weixin-java-miniapp
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-miniapp</artifactId>
<version>4.5.0</version>
</dependency>
@Autowired
private WxMaService wxMaService;
public void test() throws WxErrorException {
WxMaConfigHolder.set(WxAutoConfiguration.BUYER_DIAN_APPID);
WxMaMsgService msgService = wxMaService.getMsgService();
WxMaUniformMessage message = new WxMaUniformMessage();
message.setTemplateId("template");
message.setToUser("openid");
message.setPage("test-page");
message.addData(new WxMaTemplateData("thing1", "测试券"));
message.addData(new WxMaTemplateData("time2", "2029-01-01"));
message.addData(new WxMaTemplateData("thing4", "测试消费券"));
msgService.sendUniformMsg(message);
}
返回如下错误信息
错误代码:45103, 错误信息:This API has been unsupported rid: 64983bce-094e1a89-29c022f9,
微信原始报文:{"errcode":45103,"errmsg":"This API has been unsupported rid: 64983bce-094e1a89-29c022f9"}
你好,日志查看请求包
{"touser":"obf6I5U6RA14MCkVZ1RAt77YjUOA","weapp_template_msg":{"template_id":"pLvC2MzCvTbY_z_fjD7EMyuyJ0G0snSgt8g0EeJbB50","page":"","data":{"thing1":{"value":"测试券"},"time2":{"value":"2029-01-01"},"thing4":{"value":"测试消费券"}}}}
这个接口有没有sdk方法直接调用,还是说直接请求接口啊