跳转至

公众号底部菜单配置

底部菜单创建

微信自定义菜单创建,详细可参见微信公众平台官方技术文档,点击前往了解详情。以下做简要操作说明: 基本的菜单样式示例如下:

请求接口说明

Path: https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN
Method: POST

可参照微信详细说明文档

注意:如下示例中的appid和redirect_uri这两个参数都需要按实际情况填写:

1. 如以下所示,每个链接中都包含有公众号的appid,appid需要填写所运营的微信公众号的appid,即替换下图示例中的所有占位内容 {APPID}

2. redirect_uri 如果需要自己部署页面环境,则需要将页面入口地址提供给图灵。name字段即为菜单显示文字,可以按需求修改

3. 使用说明菜单不是必选项,如果用户需要添加使用说明,可前往图灵官网,在对应的产品apiKey下,按要求添加相关的说明,即可同步到微信该页面;如果不需要该选项,可不设置该项

4.如果设备需要接入声波联网,可接入图灵相关联网页面,需要在公众号设置该菜单;如果不需要接入,则不添加该项菜单设置。菜单内容如下:

{
        "type": "view",
        "name": "声波联网",
        "url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid={APPID}&redirect_uri=https://iot-ai.turingapi.com/jump/sonic/{APPID}&response_type=code&scope=snsapi_base&state={apiKey}#wechat_redirect",
        "sub_button": []
}

菜单请求示例

{
    "button": [
        {
            "type": "view",
            "name": "内容点播",
            "url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid={APPID}&redirect_uri=https://iot-ai.turingapi.com/jump/source/{APPID}&response_type=code&scope=snsapi_base&state=1#wechat_redirect",
            "sub_button": []
        },
        {
            "type": "view",
            "name": "设备设置",
            "url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid={APPID}&redirect_uri=https://iot-ai.turingapi.com/jump/device/{APPID}&response_type=code&scope=snsapi_base&state=1#wechat_redirect",
            "sub_button": []
        },
        {
            "name": "更多",
            "sub_button": [
                {
                    "type": "view",
                    "name": "联网绑定",
                    "url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid={APPID}&redirect_uri=https://iot-ai.turingapi.com/jump/more/bind/{APPID}&response_type=code&scope=snsapi_base&state=1#wechat_redirect",
                    "sub_button": []
                },
                {
                    "type": "view",
                    "name": "使用说明",
                    "url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid={APPID}&redirect_uri=https://iot-ai.turingapi.com/jump/more/intro/{APPID}&response_type=code&scope=snsapi_base&state=1#wechat_redirect",
                    "sub_button": []
                }
            ]
        }
    ]
}

返回说明:

{
    "errcode": 0,
    "errmsg": "ok"
}

参数说明

参数 是否必须 说明
errcode 0-成功 其他-失败
errmsg ok-成功 其他-失败描述