小編給大家分享一下微信開發(fā)之菜單查詢接口的使用示例,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
為遷安等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及遷安網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都做網(wǎng)站、成都網(wǎng)站建設(shè)、遷安網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!
使用接口創(chuàng)建自定義菜單后,開發(fā)者還可使用接口查詢自定義菜單的結(jié)構(gòu)。另外請注意,在設(shè)置了個(gè)性化菜單后,使用本自定義菜單查詢接口可以獲取默認(rèn)菜單和全部個(gè)性化菜單信息。
請求說明
http請求方式:GETapi.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN
返回說明(無個(gè)性化菜單時(shí))
對應(yīng)創(chuàng)建接口,正確的Json返回結(jié)果:
{"menu":{"button":[{"type":"click","name":"今日歌曲","key":"V1001_TODAY_MUSIC","sub_button":[]},{"type":"click","name":"歌手簡介","key":"V1001_TODAY_SINGER","sub_button":[]},{"name":"菜單","sub_button":[{"type":"view","name":"搜索","url":"www.soso.com/","sub_button":[]},{"type":"view","name":"視頻","url":"v.qq.com/","sub_button":[]},{"type":"click","name":"贊一下我們","key":"V1001_GOOD","sub_button":[]}]}]}}
返回說明(有個(gè)性化菜單時(shí))
{ "menu": { "button": [ { "type": "click", "name": "今日歌曲", "key": "V1001_TODAY_MUSIC", "sub_button": [ ] } ], "menuid": 208396938 }, "conditionalmenu": [ { "button": [ { "type": "click", "name": "今日歌曲", "key": "V1001_TODAY_MUSIC", "sub_button": [ ] }, { "name": "菜單", "sub_button": [ { "type": "view", "name": "搜索", "url": "http://www.soso.com/", "sub_button": [ ] }, { "type": "view", "name": "視頻", "url": "http://v.qq.com/", "sub_button": [ ] }, { "type": "click", "name": "贊一下我們", "key": "V1001_GOOD", "sub_button": [ ] } ] } ], "matchrule": { "group_id": 2, "sex": 1, "country": "中國", "province": "廣東", "city": "廣州", "client_platform_type": 2 }, "menuid": 208396993 } ] }
注:menu為默認(rèn)菜單,conditionalmenu為個(gè)性化菜單列表。字段說明請見個(gè)性化菜單接口頁的說明。
看完了這篇文章,相信你對“微信開發(fā)之菜單查詢接口的使用示例”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!