步骤一:
获取用户信息需要”通过微信认证“ 请确认你是否有相应权限
步骤二:
获取用户基本信息,必须提供ACCESS_TOKEN和openid 两个参数https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
//正常情况下,微信会返回下述JSON数据包给公众号:
{
"subscribe": 1,
"openid": "o6_bmjrPTlm6_2sgVt7hMZOPfL2M",
"nickname": "Band",
"sex": 1,
"language": "zh_CN",
"city": "广州",
"province": "广东",
"country": "中国",
"headimgurl": "http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4
eMsv84eavHiaiceqxibJxCfHe/0",
"subscribe_time": 1382694957,
"unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL"
"remark": "",
"groupid": 0,
"tagid_list":[128,2]
}
步骤三:
获取access_token 前需要配置IP白名单和相应设置让其有正确的访问权限
获取access_token 需要三个参数
以下是成功案例:
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140183