微信公众号 - API常见错误

Q

调用“微信公众号” API,有哪些常见错误?

✍: 哇哇网

A

调用“微信公众号” API的常见错误有:

1. 调用设备的 IP,不在公众号的 IP白名单之中。 须要在后台,把出错的 IP进入IP白名单之中。

{"errcode":40164,"errmsg":"invalid ip xx.xx.xx.xx ipv6 ::ffff:xx.xx.xx.xx,
  not in whitelist rid: 61a498c7-14194e26-7999af91"}

2. 调用的 API 没有被授权开启。 须要在后台,找到相应的接口,开启授权。

{"errcode":48001,"errmsg":"api unauthorized rid: 61a49fdf-72514848-..."}

3. access_token 过期。 须要调用 /cgi-bin/token,获取新的 access_token。

{"errcode":42001,"errmsg":"access_token expired rid: 61a4bc7d-..."}

4. 时间段有错。 须要缩短时间段,比如("begin_date": "2021-11-01", "end_date": "2021-11-02") 是一个表示 2天的时间段。

{"errcode":61501,"errmsg":"date range error rid: 61a6c37b-36a427f1-..."}

 

微信公众号 - 常见问题解答

微信公众号 - API调试工具

微信公众号 - API接口

⇑⇑ 微信公众号 - 常见问题解答

2021-11-30, 928👍, 0💬