设置自动回复 您所在的位置:网站首页 微信设置自动回复好友消息 设置自动回复

设置自动回复

2024-07-10 13:48| 来源: 网络整理| 查看: 265

# 设置自动回复-开放接口 # 配置信息

例如:

APPID: xxxxxxxxxxxxxxx TOKEN: xxxxxxxxxxxxxxx EncodingAESKey: xxxxxxxxxxxxxxx # 设置自动回复接口:

https://chatbot.weixin.qq.com/openapi/setautoreply/{TOKEN}

接口类型:

POST请求

参数说明:

字段 类型 是否必填 描述 managerid string 是 管理员id(可以是创建者、管理员的id) skillname string 是 技能名称 title string 是 标准问题 content string 是 自动回答的内容 list Array. 要设置的相似问题,比如,["问题1", "问题2"]

消息加解密接入指引

比如参数为

将加密后的数据,以字段 encrypt 放入body中

var cryptor = new WXBizMsgCrypt(TOKEN, EncodingAESKey, APPID); var data = ` ` var encrypted = cryptor.encrypt(data); curl -X post -d '{"encrypt": encrypted}' "https://chatbot.weixin.qq.com/openapi/setautoreply/{TOKEN}"

返回值说明:

字段 类型 描述 code number 错误码 msg array 接口调用信息

返回格式:

{ "errcode": 0, "msg": "成功" } # 富文本支持 纯文本 const content = "您好,请问需要什么帮助?" 文本类型(含推荐问法) const content = "暂未找到与之对应的答案,我们会尽快处理。 官方公众号:微信对话开放平台 今天北京多少度" 文本类型(含超级链接) const content = "请前往openai进行配置" H5 const content = { "news": { "articles": [{ "title": "实时更新:新型肺炎疫情最新动态", "description": "腾讯新闻第一时间同步全国新型肺炎疫情动态,欢迎关注、转发", "url": "https://news.qq.com/zt2020/page/feiyan.htm", "picurl": "http://mmbiz.qpic.cn/mmbiz_jpg/W3gQtpV3j8D8kZRqfpTJlfVqubwgFQf47H0GWlGV6leaDF80ZpdtuFhQVsCsM3YKmwkujXzdjR2k6aWfA41ic7Q/0?wx_fmt=jpeg", "type": "h5" }] } }

news.articles数组中每一项的字段描述为:

字段 类型 描述 title string 文章标题 description string 文章描述 url string 文章链接 picurl string 图片链接 type string 表示该文章的类型,有'h5'和'mp'两种,mp表示公众号文章,h5表示在对话开放平台配置的h5公众号图片 const content = { "image": { "media_id": "KegpipQG9t-klMo25My4e4BCZFcmKvgMcpMFAkC-VFE", "url": "http://mmbiz.qpic.cn/mmbiz_jpg/W3gQtpV3j8Bax22dhRiccWAb2AtVjal28XmqnhDW22dMn3RA5EoGkpolMO3tD9kQC1Hf9AjEJI66K40xQsNtXgQ/0?wx_fmt=jpeg" } }

image中每个字段描述为:

字段 类型 描述 media_id string 公众号图片素材ID url string 公众号图片url小程序 const content ={ "miniprogrampage": { "title": "openai对话插件", "appid": "wx8c631f7e9f2465e1", "pagepath": "pages/index/index", "thumb_media_id": "KegpipQG9t-klMo25My4e8zpBjhjg3JMrMSpgjikB4U", "thumb_url": "http://mmbiz.qpic.cn/mmbiz_png/W3gQtpV3j8BYhWgfHT5Hfg6auN94c2ec4BBhDOMtPQrx6vEMc1rR4iaDKxDLOfZ1jBUqIEEY4YpvEj6ktSyXT7g/0?wx_fmt=png" } }

miniprogrampage中每个字段描述为:

字段 类型 描述 title string 小程序标题 appid string appid pagepath string 小程序跳转页面路径 thumb_media_id string 公众号图片素材ID thumb_url string 公众号图片url合并回答 { "multimsg": ["您好", { "image": { "media_id": "KegpipQG9t-klMo25My4e4BCZFcmKvgMcpMFAkC-VFE", "url": "http://mmbiz.qpic.cn/mmbiz_jpg/W3gQtpV3j8Bax22dhRiccWAb2AtVjal28XmqnhDW22dMn3RA5EoGkpolMO3tD9kQC1Hf9AjEJI66K40xQsNtXgQ/0?wx_fmt=jpeg" } }, { "miniprogrampage": { "title": "openai对话插件", "appid": "wx8c631f7e9f2465e1", "pagepath": "pages/index/index", "thumb_media_id": "KegpipQG9t-klMo25My4e8zpBjhjg3JMrMSpgjikB4U", "thumb_url": "http://mmbiz.qpic.cn/mmbiz_png/W3gQtpV3j8BYhWgfHT5Hfg6auN94c2ec4BBhDOMtPQrx6vEMc1rR4iaDKxDLOfZ1jBUqIEEY4YpvEj6ktSyXT7g/0?wx_fmt=png" }] } 字段 类型 描述 multimsg array 合并回答列表,数组中的每一项为以上单一类型的集合,每一个类型参考其对应的数据结构# 错误码说明: { errcode: 1001, errmsg: "TOKEN is not valid" } 错误码 描述 1001 token无效 1002 机器人审核没有通过 1003 签名缺少userid字段 1004 签名字段为空 1005 签名过期或无效 1006 签名校验失败,缺少userid字段 1007 appid, category,label, desc 字段不能未空 1008 appid, openid,msg, 字段不能未空


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有