调用convert_to_userid接口将openid转userid时返回错误码43004

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:05 989 0 全屏看文

AI助手支持GPT4.0

调用convert_to_userid接口将openid转userid时返回错误码43004
项目中,小程序调用wx.login方法获取code,在服务端调用https://api.weixin.qq.com/sns/jscode2session接口拿到openid,再调用https://qyapi.weixin.qq.com/cgi-bin/user/convert_to_userid接口拿到userid。但是在调用convert_to_userid接口时,有些正常返回userid,有些账号返回43004,查了这个错误码,说原因是指定的userid未绑定微信或未关注微工作台(原企业号),但是这些微信号都不是企业内部成员,为什么有些就能获取到userid?项目已经在生产运行的,最近一周这种情况很严重,之前偶尔出现。ps:最近一个月没有发版。有大佬帮忙解答一下吗?非常感谢!

In the project, the applet calls wx.login Method to get the code and call it on the server side https://api.weixin.qq.com/sns/jscode2session Interface to get openid, and then call https://qyapi.weixin.qq.com/cgi-bin/user/convert_ To_ The userid interface gets the userid. But you are calling convert_ To_ When using the userid interface, some users return userid normally and some accounts return 43004. After checking this error code, they say that the reason is that the specified userid is not bound to wechat or does not pay attention to the micro workbench (the original enterprise number), but these micro signals are not internal members of the enterprise. Why can some users get the userid? The project has been in production and operation. This situation is very serious in the last week, and it happened occasionally before. PS: no release in the last month. Do you have any help to answer it? Thank you very much.

回答:

企业微信运营专员-千夜:

您好,如果用户是企业内的成员,那么他消费code的时候就会返回用户的userid了的了,非企业内成员是不会返回userid的,这里非企业内成员也能获取到userid能否提供下截图 openid 转换获取到的corpid和userid看下

-EOF-

AI助手支持GPT4.0