If the official account is based on security considerations for message reception , it needs to know the IP address list of the WeChat server in order to identify which messages are officially pushed to you by WeChat and which messages may be forged by others. You can obtain the WeChat server IP address list through this interface.
Interface call request description
http request method: GEThttps://api.weixin.qq.com/cgi-bin/getcallbackip?access_token=ACCESS_TOKEN
Return instructions
Under normal circumstances, WeChat will return the followingJSON data packet to the public account:
{ "ip_list":["127.0.0.1","127.0.0.1"] }
When an error occurs, WeChat will return error code and other information. The JSON data packet example is as follows (this example is an invalid AppID error):
{"errcode":40013,"errmsg":"invalid appid"}
Special recommendation: "php Programmer Toolbox" V0.1 version download
2.WeChat public account platform source code download
3.Alizi order system source code download
The above is the detailed content of WeChat development to obtain server IP. For more information, please follow other related articles on the PHP Chinese website!