请求企业微信接口 获取不到userTicket?
提问
1.问题描述:
请求企业微信接口 https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE
返回数据:
{"DeviceId":"bf3062e6d0b16333","UserId":"13527840460","errcode":0,"errmsg":"ok"}
获取不到userTicket参数,由于userTicket为空导致
2.企业微信应用:首页和主菜单配置信息如下:
https://open.weixin.qq.com/connect/oauth2/authorize?
appid=ww1f5e85e0f4b36866
&redirect_uri=http%3A%2F%2Fgcgl.cckkd.com%3A39199%2Fzgmei%2Fstatic%2Fwechat%2Findex.html
%3F
corp_id=ww1f5e85e0f4b36866
%26
agent_id=1000005&response_type=code&scope=snsapi_base&state=#wechat_redirect
3.scope调整成 snsapi_privateinfo,提示:无效的agentId参数,
4.可用范围设置,如图附件
您好,这边打开提示appid无效,请检查传入的appid是否正确。
请求企业微信接口 https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE
返回数据:
{"DeviceId":"bf3062e6d0b16333","UserId":"13527840460","errcode":0,"errmsg":"ok"}
获取不到userTicket参数,如何解决呢?
在哪里查看appid?
您好,这里appid是怎么获取到的呢
https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww1f5e85e0f4b36860&redirect_uri=http%3A%2F%2Fgcgl.ccggd.com%3A29109%2Fzhongmei%2Fstatic%2Fwechat%2Findex.html%3Fcorp_id=ww1f5e85e0f4b36860%26agent_id=1000003&response_type=code&scope=snsapi_userinfo&state=#wechat_redirect
完整路径如下:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww1f5e85e0f4b36860&redirect_uri=http%3A%2F%2Fgcgl.ccggd.com%3A29109%2Fzhongmei%2Fstatic%2Fwechat%2Findex.html%3Fcorp_id=ww1f5e85e0f4b36860%26agent_id=1000003&response_type=code&scope=snsapi_privateinfo&state=#agentid=1000003#wechat_redirect
还是报错:
agentid=1000003 提示报错信息
https://developer.work.weixin.qq.com/document/path/91022
配置 &agentid=1000003 后目前可以拿到 user_ticket