博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Solve Error: "errcode": 40016, "errmsg": "invalid button size hint"
阅读量:6267 次
发布时间:2019-06-22

本文共 3124 字,大约阅读时间需要 10 分钟。

 

在使用微信官方给的添加自定义菜单的示例代码:

 

{    "button": [        {            "name": "扫码",             "sub_button": [                {                    "type": "scancode_waitmsg",                     "name": "扫码带提示",                     "key": "rselfmenu_0_0",                     "sub_button": [ ]                },                 {                    "type": "scancode_push",                     "name": "扫码推事件",                     "key": "rselfmenu_0_1",                     "sub_button": [ ]                }            ]        },         {            "name": "发图",             "sub_button": [                {                    "type": "pic_sysphoto",                     "name": "系统拍照发图",                     "key": "rselfmenu_1_0",                    "sub_button": [ ]                 },                 {                    "type": "pic_photo_or_album",                     "name": "拍照或者相册发图",                     "key": "rselfmenu_1_1",                     "sub_button": [ ]                },                 {                    "type": "pic_weixin",                     "name": "微信相册发图",                     "key": "rselfmenu_1_2",                     "sub_button": [ ]                }            ]        },         {            "name": "发送位置",             "type": "location_select",             "key": "rselfmenu_2_0"        },        {           "type": "media_id",            "name": "图片",            "media_id": "MEDIA_ID1"        },         {           "type": "view_limited",            "name": "图文消息",            "media_id": "MEDIA_ID2"        }    ]}

 

可能会遇到如下的错误:

Connection: keep-aliveDate: Sat, 24 Nov 2018 00:58:30 GMTContent-Type: application/json; encoding=utf-8Content-Length: 71{    "errcode": 40016,     "errmsg": "invalid button size hint: [dNjLEa01101961]"}

 

原因可能是因为想展示的按钮太多了,装不下了,去掉最后两个就好了:

 

{    "button": [        {            "name": "扫码",             "sub_button": [                {                    "type": "scancode_waitmsg",                     "name": "扫码带提示",                     "key": "rselfmenu_0_0",                     "sub_button": [ ]                },                 {                    "type": "scancode_push",                     "name": "扫码推事件",                     "key": "rselfmenu_0_1",                     "sub_button": [ ]                }            ]        },         {            "name": "发图",             "sub_button": [                {                    "type": "pic_sysphoto",                     "name": "系统拍照发图",                     "key": "rselfmenu_1_0",                     "sub_button": [ ]                },                 {                    "type": "pic_photo_or_album",                     "name": "拍照或者相册发图",                     "key": "rselfmenu_1_1",                     "sub_button": [ ]                },                 {                    "type": "pic_weixin",                     "name": "微信相册发图",                     "key": "rselfmenu_1_2",                     "sub_button": [ ]                }            ]        },         {            "name": "发送位置",             "type": "location_select",             "key": "rselfmenu_2_0"        }    ]}

 

转载地址:http://yidpa.baihongyu.com/

你可能感兴趣的文章
axios请求requestBody和formData
查看>>
PSQL_标准API和Interface基本的用法和比较(概念)
查看>>
网站目录
查看>>
APUE-文件和目录(七)符号链接
查看>>
CSS 简介
查看>>
System Verilog基础(二)
查看>>
2018/11/26 Samba服务器配置
查看>>
2018/12/08 PAT刷题 L1-034 点赞
查看>>
如何改变TextBox.PassWordChar的值 转
查看>>
css的工作原理
查看>>
【pip】的安装
查看>>
内存泄漏及其检测工具
查看>>
QT Model based vs Item based
查看>>
[Leetcode]669 Trim a Binary Search Tree
查看>>
Linux C Programing - Arguments(2)
查看>>
禁止选择文本和禁用右键 v1.0
查看>>
swift 动画
查看>>
can 驱动
查看>>
Linux使用ASF云挂卡(挂游戏时长)
查看>>
UML入门 之 交互图 -- 时序图 协作图详解
查看>>