String url="https://api.weixin.qq.com/wxa/business/getuserphonenumber?scope=snsapi_userinfo&access_token=ACCESS_TOKEN&code=CODE";
url = url.replace("ACCESS_TOKEN", token).replace("CODE", code);
String postResult = HttpUtil.post(url, "{}");
{"errcode":40029,"errmsg":"invalid code hint: [XfmcTVNre-vGNNia] rid: 628da727-52e5b3c7-79315d09"}
网友回复
Mr.YAO:
请参考示例
code 以 JSON 字符串格式写在 POST 请求的 body 中
Lipeng:
这个接口要传入code参数的。可通过前端bindgetphonenumber获得
https://developers.weixin.qq.com/miniprogram/dev/component/button.html