If the official account is based on security and other considerations, it is necessary to obtain the IP address list of the WeChat server for relevant restrictions. You can obtain the IP address list or IP network segment information of the WeChat server through this interface.
Interface call request description
http request method: GET https://api.weixin.qq.com/cgi-bin/getcallbackip?access_token=ACCESS_TOKEN |
Parameter Description
parameter | Is it necessary | illustrate |
---|---|---|
access_token | Yes | The access_token of the official account |
Back to Instructions
Under normal circumstances, WeChat will return the following JSON data package to the official account:
{ "ip_list": [ "127.0.0.1", "127.0.0.2", "101.226.103.0/25" ] } |
parameter | illustrate |
---|---|
ip_list | WeChat server IP address list |
When there is an error, WeChat will return the error code and other information. The example of the JSON data package is as follows (the example is an invalid AppID error):
{"errcode":40013,"errmsg":"invalid appid"} |