刚辞职的同事用JAVA给客户开发的微信公众平台,今天晚上客户给我打电话说出现错误,此时我正跟朋友在外吃饭,联系已辞职的同事也联系不上,便答应回去之后我给调试看下。
问明客户说就修改了appkey和appsecret两个串值,试了下公众号才看出请求的url中的appid还是老的,便利用开发者接口测试工具经过多次实验后才发现原来是创建自定义菜单的json字符串错误,提交的json字符串格式如:
{"menu":{"button":[{"name":"功能","sub_button"。。。。。。。。。
如此提交便出现error code 40016, Invlid button size 的错误,正确的应为去掉
{"menu":..}这个
如下
{"button":[{"name":"功能","sub_button":[{"type":"view","name":"订单号绑定","url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4a48823aa0c3d015&redirect_uri=http%3a%2f%2fwww.5454555.com/wechat%2fm%2fuser!prebuyvip.do&response_type=code&scope=snsapi_base&state=123#wechat_redirec……[]}]},{"name":"帮助","sub_button":[{"type":"click","name":"如何绑定","key":"如何绑定","sub_button":[]}]}]}