String access_token = "62_F7kcG58SxnlwuGrMru_u7hrd-NV7WbiIHuO0JlBXjXkW8-4qgbvgbAZnSOv0yH1mzcxAOw311kQRZribn_kBbsqQ38AxAiYGFJkLfzss3XXWQDTxb3_dihyHqTFXvLAwuUuftismVRUmDa2qNDGeAAAJZC";
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("path", "pages/mobile/index");
map.put("query", "qid=1234");
map.put("expire_type", 30 + "");
map.put("expire_time", 30 + "");
//
try {
String result = HttpRequester.sendPostStreamHandler(
"https://api.weixin.qq.com/wxa/generate_urllink?access_token=ACCESS_TOKEN", JSON.toJSONString(map),
HttpRequester.getJsonType());
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
}
{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest rid: 6358a9b2-5715b19d-449957d7"}
要用最后刷新的那个token,旧的token不能保证有效