溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

微信開發(fā)之菜單查詢接口的使用示例

發(fā)布時(shí)間:2021-01-21 15:05:31 來源:億速云 閱讀:163 作者:小新 欄目:移動(dòng)開發(fā)

小編給大家分享一下微信開發(fā)之菜單查詢接口的使用示例,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

使用接口創(chuàng)建自定義菜單后,開發(fā)者還可使用接口查詢自定義菜單的結(jié)構(gòu)。另外請(qǐng)注意,在設(shè)置了個(gè)性化菜單后,使用本自定義菜單查詢接口可以獲取默認(rèn)菜單和全部個(gè)性化菜單信息。

請(qǐng)求說明

http請(qǐng)求方式:GETapi.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN

返回說明(無個(gè)性化菜單時(shí))

對(duì)應(yīng)創(chuàng)建接口,正確的Json返回結(jié)果:
{"menu":{"button":[{"type":"click","name":"今日歌曲","key":"V1001_TODAY_MUSIC","sub_button":[]},{"type":"click","name":"歌手簡(jiǎn)介","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": "中國(guó)",
                "province": "廣東",
                "city": "廣州",
                "client_platform_type": 2
           },
             "menuid": 208396993
        }
    ]
}

注:menu為默認(rèn)菜單,conditionalmenu為個(gè)性化菜單列表。字段說明請(qǐng)見個(gè)性化菜單接口頁的說明。

看完了這篇文章,相信你對(duì)“微信開發(fā)之菜單查詢接口的使用示例”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI