WeChat Public PlatformCustom MenuPHP development, how is the WeChat Public Platform custom menu implemented? In fact, it is very simple. First, upgrade to a service account on the WeChat public platform, obtain the appid and appsecret, then obtain the access_token based on these two parameters, and then post a string of characters to the WeChat server based on the access_token.
Before using the generalinterface, you need to do the followingtwo-step work:
1. Have a WeChat public account and obtainappidandappsecret(apply for internal testing qualifications on the public platform, andreviewcan be obtained after passing)
2. Obtained through the certificate acquisition interfaceaccess_token
Note:
access_token is a ticket for third-party access to api resources;
access_token corresponds to the public account and is globally unique If you obtain the ticket repeatedly, the access_token obtained last time will become invalid.
Visit the following address (note to replace your appid and secret):
api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
Then you can see the return information in the browser:
{"access_token":"这里就是你的access_token","expires_in":7200}
Create a custom menu:
Copy after login
The above is the detailed content of PHP implements creating WeChat custom menu instance. For more information, please follow other related articles on the PHP Chinese website!