微信接口创建菜单40016,Invalid button size

查询接口

  • 创建菜单时参考文档,最好不要直接复制查询菜单接口的响应:
    https://mp.weixin.qq.com/wiki/10/0234e39a2025342c17a7d23595c6b40a.html

  • 调用菜单查询接口时,返回如下

200 OK
Connection: close
Date: Fri, 30 Dec 2016 07:02:32 GMT
Content-Type: application/json; encoding=utf-8
Content-Length: 349
{
    "menu": {
        "button": [
            {
                "name": "一级菜单", 
                "sub_button": [
                    {
                        "type": "view", 
                        "name": "用户", 
                        "url": "xxx", 
                        "sub_button": [ ]
                    }
                ]
            }
        ]
    }
}
  • 最好不要直接把这个结果做修改,然后调用创建菜单接口,一定要注意最外层没有menu

创建接口

{
    "button": [
        {
            "name": "hyq", 
            "sub_button": [
                {
                    "type": "view", 
                    "name": "用户", 
                    "url": "xxx", 
                    "sub_button": [ ]
                }
            ]
        }
    ]
}

你可能感兴趣的:(微信开发方面)