public static void send() {
resetAccessToken();
Map map=new HashMap();
map.put("touser", "********");
map.put("template_id", "4JI-********-HSTvHg");
Map data = new HashMap();
Map data1 = new HashMap();
data1.put("value", "ceshi");
Map data2 = new HashMap();
data2.put("value", "2020-09-09 12:12:09");
Map data3 = new HashMap();
data3.put("value", "haha");
data.put("thing1", data1);
data.put("time2", data2);
data.put("thing4", data3);
map.put("data", data);
System.out.println(JSON.toJSONString(map));
String result = PostUtil.httpsRequest(" https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="
+ access_token,"POST",JSON.toJSONString(map));
JSONObject jsonobjkf = JSONObject.fromObject(result);
}
但是 openID 是通过授权存到数据库里面的,可是一直提示touser字段openid为空或者不正确
求解答,谢谢
JSON格式
{
"data":{
"thing1":{
"value":"ceshi"
},
"thing4":{
"value":"haha"
},
"time2":{
"value":"2020-09-09 12:12:09"
}
},
"miniprogramState":"trial",
"template_id":"4JI-*********8-HSTvHg",
"touser":"*******-Bv2Oo"
}