Home  >  Article  >  WeChat Applet  >  WeChat development to obtain public account configuration

WeChat development to obtain public account configuration

Y2J
Y2JOriginal
2017-05-17 16:10:482625browse

This interface will provide the configuration of the custom menu currently used by the public account. If the public account is a menu set through API calls, the development configuration of the menu will be returned. If the public account is published through the website function on the official website of the public platform menu, this interface returns the menu configuration set by the operator.

Please note:

1. Third-party platform developers can use this interface to detect the public immediately after their official account authorizes the business to you. Custom menu configuration of the account, and set automatic reply rules for the public account again through the interface to improve the business experience of the public account operator.
2. The difference between this interface and Custom menu query interface is that this interface can query the interface no matter how the public account interface is set, while the custom menu query interface Only the menu configuration set using the API can be queried.
3. Certified/uncertified service accounts/subscription accounts, and interface test accounts all have this interface permission.
4. From the third-party platform’s public account login authorization mechanism , this interface belongs to the message and menu permission set.
5. The pictures/voice/video returned in this interface are not temporary materials (temporary materials are different each time they are obtained, and are valid within 3 days. Get temporary materials through material management- interface to obtain these materials), the graphic messages returned by this interface are permanent materials (obtain these materials through the Material Management-Obtain Permanent Materials interface).

Interface call request description

http request method: GET (please use https protocol) api.weixin.qq.com/cgi-bin/get_current_selfmenu_info? access_token=ACCESS_TOKEN

Return result description

If the public account releases the menu through the website function on the official website of the public platform, the custom menu configuration returned by this interface The sample is as follows:

{ 
   "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": "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": "mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKnmnpXYgWmQD5gXUrEApIYBCgvh2yHsu3ic3anDUGtUCHwjiaEC5bicd7A/0", 
                                       "content_url": "mp.weixin.qq.com/s?biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=2&sn=8226843afb14ecdecb08d9ce46bc1d37#rd", 
                                       "source_url": ""
                                   }
                               ]
                           }
                       },
                       {
                           "type": "video", 
                           "name": "video", 
                           "value": "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 is a menu set through API call, the custom menu configuration sample is as follows:

{ 
   "is_menu_open": 1, 
   "selfmenu_info": { 
       "button": [ 
           { 
               "type": "click", 
               "name": "今日歌曲", 
               "key": "V1001_TODAY_MUSIC"
           }, 
           { 
               "name": "菜单", 
               "sub_button": { 
                   "list": [ 
                       { 
                           "type": "view", 
                           "name": "搜索", 
                           "url": "http://www.soso.com/"
                       }, 
                       { 
                           "type": "view", 
                           "name": "视频", 
                           "url": "http://v.qq.com/"
                       }, 
                       { 
                           "type": "click", 
                           "name": "赞一下我们", 
                           "key": "V1001_GOOD"
                       }
                   ]
               }
           }
       ]
   }
}

Parameter description

WeChat development to obtain public account configuration

【Related Recommendations】

1. Special Recommendation:"php Programmer Toolbox" V0.1 version download

2. WeChat public account platform source code download

3. WeChat voting source code download

The above is the detailed content of WeChat development to obtain public account configuration. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn