This API is used to provide the configuration of the current custom menu. If the Official Account's menu is configured via API, the development configuration of the menu is returned. If the Official Account publishes the menu via website feature on the Official Accounts Platform, then this API returns the menu configuration set by the operator.
Notes:
1. After the third-party platform developer authorizes the business of its Official Account to you, it can use this API to detect the custom menu configuration of the Official Account, and set the automatic reply rule to the Official Account to improve the business running experience of the Official Account operator.
2. Different from the Query Custom Menu API, this API can query the configuration of the Official Account's menu no matter how it is set. However, the Query Custom Menu API is only used to query the configuration of the menu set via API.
3. Verified/Unverified Service Accounts/Subscription Accounts and API test accounts can access to this API.
4. In terms of the Official Account login authorization mechanism of the third-party platform, the API belongs to the message and menu permission set.
5. The images/voices/videos returned via this API are temporary media (different temporary media are obtained each time via the Media Asset Management - Get Temporary Media API, which are valid for 3 days). The articles returned via this API are permanent media (which are obtained via the Media Asset Management - Get Permanent Media API).
API Request Format
HTTP request method: GET (HTTPS protocol should be used) https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token=ACCESS_TOKEN
Response
If the Official Account publishes the menu via website feature on the Official Accounts Platform, then the API returns the custom menu configuration like this:
{
"is_menu_open": 1,
"selfmenu_info": {
"button": [
{
"name": "button",
"sub_button": {
"list": [
{
"type": "view",
"name": "view_url",
"url": "http://www.qq.com"
},
{
"type": "news",
"name": "news",
"value":"KQb_w_Tiz-nSdVLoTV35Psmty8hGBulGhEdbb9SKs-o",
"news_info": {
"list": [
{
"title": "MULTI_NEWS",
"author": "JIMZHENG",
"digest": "text",
"show_cover": 0,
"cover_url": "http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfK0HKuBIa1A1cypS0uY1wickv70iaY1gf3I1DTszuJoS3lAVLvhTcm9sDA/0",
"content_url": "http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=1&sn=80ce6d9abcb832237bf86c87e50fda15#rd",
"source_url": ""
},
{
"title": "MULTI_NEWS1",
"author": "JIMZHENG",
"digest": "MULTI_NEWS1",
"show_cover": 1,
"cover_url": "http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKnmnpXYgWmQD5gXUrEApIYBCgvh2yHsu3ic3anDUGtUCHwjiaEC5bicd7A/0",
"content_url": "http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=2&sn=8226843afb14ecdecb08d9ce46bc1d37#rd",
"source_url": ""
}
]
}
},
{
"type": "video",
"name": "video",
"value": "http://61.182.130.30/vweixinp.tc.qq.com/1007_114bcede9a2244eeb5ab7f76d951df5f.f10.mp4?vkey=77A42D0C2015FBB0A3653D29C571B5F4BBF1D243FBEF17F09C24FF1F2F22E30881BD350E360BC53F&sha=0&save=1"
},
{
"type": "voice",
"name": "voice",
"value": "nTXe3aghlQ4XYHa0AQPWiQQbFW9RVtaYTLPC1PCQx11qc9UB6CiUPFjdkeEtJicn"
}
]
}
},
{
"type": "text",
"name": "text",
"value": "This is text!"
},
{
"type": "img",
"name": "photo",
"value": "ax5Whs5dsoomJLEppAvftBUuH7CgXCZGFbFJifmbUjnQk_ierMHY99Y5d2Cv14RD"
}
]
}
}
If the Official Account's menu is configured via API, the custom menu configuration is returned like this:
{
"is_menu_open": 1,
"selfmenu_info": {
"button": [
{
"type": "click",
"name": "Today's songs",
"key": "V1001_TODAY_MUSIC"
},
{
"name": "Menu",
"sub_button": {
"list": [
{
"type": "view",
"name": "Search",
"url": "http://www.soso.com/"
},
{
"type": "view",
"name": "Video",
"url": "http://v.qq.com/"
},
{
"type": "click",
"name": "Give us a like",
"key": "V1001_GOOD"
}
]
}
}
]
}
}
Parameters
Parameter | Description |
---|---|
is_menu_open | Indicates whether the menu is enabled. 0: Unabled; 1: Enabled |
selfmenu_info | Menu information |
button | Menu button |
type | Menu type. Supported types on the Official Accounts Platform include view (redirects to URL), text (text is returned, the same below), img, photo, video, and voice. Eight types of menus set via API are supported. See Create Custom Menu API for details. |
name | Menu name |
Fields such as value, url and key | The description of "value" varies with different menu types. For custom menus set on the official website: Text: Save text to value; Img and voice: Save mediaID to value; Video: Save video download link to value; News: Save article to news_info and save mediaID to value; View: Save URL to url. For custom menus set via API: click, scancode_push, scancode_waitmsg, pic_sysphoto, pic_photo_or_album, pic_weixin, and location_select: Save value to key; view: Save URL to url. |
news_info | Article information |
title | The article's title |
digest | Summary |
author | The author |
show_cover | Indicates whether to display the cover. 0: False; 1 True |
cover_url | Cover image URL |
content_url | Text URL |
source_url | Original text URL. The "Read More" entry is not displayed when this is left empty. |