参考官方文档:
https://developers.weixin.qq.com/doc/offiaccount/Custom_Menus/Personalized_menu_interface.html
1 首先有access_token?
在 服务号的白名单加入ip,用APPID和APPsecret请求地址
可以使用官方工具请求接口
https://mp.weixin.qq.com/debug/cgi-bin/apiinfo?t=index&type=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95&form=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%9B%E5%BB%BA%E6%8E%A5%E5%8F%A3%20/menu/creat
2 写入参格式
比如:
{ "button": [ { "type": "click", "name": "今日歌曲", "key": "V1001_TODAY_MUSIC" }, { "name": "菜单", "sub_button": [ { "type": "view", "name": "搜索", "url": "http://www.soso.com/" }, { "type": "miniprogram", "name": "wxa", "url": "http://mp.weixin.qq.com", "appid": "wx286b93c14bbf93aa", "pagepath": "pages/lunar/index" }, { "type": "click", "name": "赞一下我们", "key": "V1001_GOOD" } ] } ], "matchrule": { "tag_id": "2", "sex": "1", "country": "中国", "province": "广东", "city": "广州", "client_platform_type": "2", "language": "zh_CN" } }