微信接口调用限制

使用企业微信中通过手机号获取微信ID的接口报错,超出频率限制

通过手机号获取其所对应的userid

请求方式:POST(HTTPS)
请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN

{"mobile":"15168888888"}
<<<<<<<<
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 21 Feb 2021 24:00:00 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 201
Connection: keep-alive
Error-Code: 45009
Error-Msg: api freq out of limit, hint: [1613886037_148_56f47259fca07048efad5d59a76dee0a], from ip: 115.115.115.115, more info at https://open.work.weixin.qq.com/devtool/query?e=45009

{"errcode":45009,"errmsg":"api freq out of limit, hint: [1613887777_148_56f47259fca07048efad5d59a76aee0b], from ip: 115.115.115.115, more info at https://open.work.weixin.qq.com/devtool/query?e=45009"}
--------
NULL  
[2021-02-21T13:40:37.411709+08:00] EasyWeChat.DEBUG: >>>>>>>>
POST /cgi-bin/message/send?access_token=CqHoppLd7Y_GrbyNgOsKb_twMpfmlg63fQ52xd4GKA9VtQIQSg0zOAUmUptjJ9zZVlQIbmUffYXp-i-KNFlTSanvO5aGznep8m02z_ogLcAibpbgHjvS93qAztTFM33f4nFbkWk9rulXg7rVusTKrgtNsGcYLs1gSayUucGJAnqGtllQPOkQQ6lgHBhE5hPtW1AIqyAKswjUsUghp7Ag9g HTTP/1.1
Host: qyapi.weixin.qq.com
Content-Length: 445
User-Agent: GuzzleHttp/6.5.4 curl/7.70.0 PHP/7.4.9
Content-Type: application/json

官方接口文档:https://work.weixin.qq.com/api/doc/90001/90143/91693

由于应用须拥有指定成员的查看权限,而发送的有些人没有这个权限,所以会报错

文档中有说明:

请确保手机号的正确性,若出错的次数较多,会导致1天不可调用

所以原因是多次尝试出错,导致了整个接口都无法调用了

解决方法是尽量不要频繁使用这一个接口。而是将用户已知的ID保存在数据库中,如果数据库中没有或出错再退而求其次的请求这个接口