Development (3) create a menu and create a menu
Author: Songyang
This article is from Ashura road and is prohibited for commercial purposes. For more information, see the source.
Link: http://blog.csdn.net/fansongy/article/details/43406073
Overview
If you select a development version, you cannot useFunctionInCustom menuTool, you need to manually add it using the code. This article describes how to add custom menus through http requests.
Principles and tools
If you want to add your own menu, you need to send the create menu message to a URL. You only need to send the changes once to save the changes.
A debugging tool can directly send the edited information to the corresponding website.
Create menu
First, obtain the AccessToken. For more information about how to operate the shoes, see here.
After obtaining the token, enter it after "access_token" of the tool, and then enter a json text in the following format in the body input box:
{"Button": [{"type": "click", "name": "Today's songs", "key": "V1001_TODAY_MUSIC" },{ "name ": "menu", "sub_button": [{"type": "view", "name": "Search", "url": "http://www.soso.com /"}, {"type": "view", "name": "video", "url": "http://v.qq.com/" },{ "type": "click", "name ": "like us", "key": "V1001_GOOD"}]}
There are many types of menu buttons to add, which are usually 3 or 4. For more information, see the official documentation here.
Send add
After entering the information, click the following button to submit the information. It is said that there is a 24-hour delay, and it takes effect immediately after I send it. In addition, an error is reported, and the return code is40001After a while, nothing changed, but the submission was successful. It is estimated that there is a small Bug :)