PHP implements creating WeChat custom menu instance

零下一度
Release: 2023-03-14 07:54:01
Original
2196 people have browsed it

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}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!