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
Have you ever been disturbed by noise? For exampl...
When the CEOs of Intel and Microsoft, first-line ...
How to make an online promotion plan? How to form...
Be a long-termist and try to maximize the experie...
If you walk by the river often, you will get your...
Oyster sauce is a common seasoning in the kitchen...
In the current information flow industry, short v...
Everyone knows that they should read more books a...
The celebration of both National Day and Mid-Autu...
If we want to achieve better development, we must...
Conversion is the key factor in paid promotion . ...
Many people like to collect ceramic bowls recentl...
During the 2019 Double 11 shopping festival, Taob...
In my eyes, clean code is simple and easy to unde...
Is content management difficult? Someone said, gi...