Currently, a custom menu can contain up to 3 first-level menus, and each first-level menu can contain up to 5 second-level menus. A first-level menu can contain up to 4 Chinese characters, and a second-level menu can contain up to 7 Chinese characters. The extra characters will be replaced by "...". Please note that after creating a custom menu, it will take 24 hours for the WeChat client to display it due to the WeChat client cache. It is recommended that you try to unfollow the public account and then follow it again during testing, so that you can see the effect after creation. The custom menu interface can implement various types of buttons, as follows: 1. click: click push event When the user clicks a click type button, the WeChat server will push a message structure of event type to the developer through the message interface (refer to the message interface guide), and bring the key value filled in by the developer in the button. The developer can interact with the user through the customized key value; 2. view: jump to URL After the user clicks a view type button, the WeChat client will open the web URL filled in by the developer in the button, which can be combined with the web page authorization to obtain the user's basic information interface to obtain the user's basic information. 3. scancode_push: scan code push event After the user clicks the button, the WeChat client will call up the scanning tool. After completing the scanning operation, the scanning result will be displayed (if it is a URL, the URL will be entered), and the scanning result will be transmitted to the developer, who can then send a message. 4. scancode_waitmsg: Scan the code to push the event and pop up the "Message Receiving" prompt box After the user clicks the button, the WeChat client will call up the scanning tool. After completing the scanning operation, it will transmit the scanning result to the developer and close the scanning tool. Then a "Message Receiving" prompt box will pop up, and the user may then receive a message from the developer. 5. pic_sysphoto: pop-up system to take pictures and send pictures After the user clicks the button, the WeChat client will call up the system camera. After completing the photo-taking operation, it will send the taken photo to the developer and push an event to the developer. At the same time, the system camera will be closed, and the developer may receive a message from the developer afterwards. 6. pic_photo_or_album: pop up to take a photo or send a photo to the album After the user clicks the button, the WeChat client will pop up a selector for the user to choose "take a photo" or "select from the phone album". After the user makes a choice, the other two processes will be followed. 7. pic_weixin: pop up WeChat photo album sender After the user clicks the button, the WeChat client will call up the WeChat album. After completing the selection operation, it will send the selected photos to the developer's server and push events to the developer. At the same time, the album will be closed, and the user may then receive a message from the developer. 8. location_select: Pop-up location selector After the user clicks the button, the WeChat client will call up the location selection tool. After completing the selection operation, the selected location will be sent to the developer's server and the location selection tool will be closed. The user may then receive a message from the developer. Please note that all events from 3 to 8 are only supported by WeChat iPhone version 5.4.1 and above, and WeChat users of Android version 5.4 and above. Users of old WeChat versions will not receive any response after clicking, and developers will not be able to receive event push normally. Interface call request description http request method: POST (please use https protocol) https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN Click and view request examples
Request examples for other newly added button types
Return results The correct returned JSON data packet is as follows: {"errcode":0,"errmsg":"ok"} The returned JSON data packet in case of an error is as follows (the example shows the invalid menu name length): {"errcode":40018,"errmsg":"invalid button name size"} |
<<: Status bar prompts with various effects
>>: Data statistics interface-graphic and text analysis data interface
Since its release, Model 3 has launched minor mod...
[[173391]] UUID The node-uuid module can quickly ...
The China Earthquake Networks Center officially d...
Recently, the business direction of the docking h...
“America’s auto dealers are getting people back t...
Everyone should have had this feeling: when you a...
We all know that the task of most landing pages i...
APPs are one of the most influential innovations ...
[[138339]] Sources revealed that Samsung will use...
1. What is the user growth system? The evolution ...
For flower shop owners, offline channels can no l...
If you open the calendar, you will find that 2024...
Several ways to quickly create popular articles i...
"Story of Yanxi Palace" dominated the s...