基于GEWE框架实现微信关键字回复

友情链接 geweapi.com 点击即可访问

发送app类型消息

小提示:

  • 发送一些特殊的消息类型
  • 注意参数

请求URL:

请求方式:

  • POST

请求头:

  • Content-Type:application/json

  • X-GEWE-TOKEN: 后台获取

参数:

参数名称 数据类型 必填 说明
appid string 设备id
to_wxid string 接收人 wxid/chatroomid
xml string app消息的xml,截取< appmsg >节点内容

返回数据:

参数名 数据类型 说明
ret number 0:成功
msg string 反馈信息
msg_err string 反馈错误信息
data object
List.ToUsetName object 对方用户
List.MsgId Number 消息id

请求参数示例:

复制代码
    {
        "appid": "wx_ECMY4oEDuQAP6WimpWwWv",
        "to_wxid": "xxxxxxxx",
        "xml": "<appmsg appid="" sdkver="0">\n\t\t<title>腾讯云助手</title>\n\t\t<des>腾讯云助手</des>\n\t\t<action />\n\t\t<type>33</type>\n\t\t<showtype>0</showtype>\n\t\t<soundtype>0</soundtype>\n\t\t<mediatagname />\n\t\t<messageext />\n\t\t<messageaction />\n\t\t<content />\n\t\t<contentattr>0</contentattr>\n\t\t<url />\n\t\t<lowurl />\n\t\t<dataurl />\n\t\t<lowdataurl />\n\t\t<appattach>\n\t\t\t<totallen>0</totallen>\n\t\t\t<attachid />\n\t\t\t<emoticonmd5></emoticonmd5>\n\t\t\t<fileext />\n\t\t\t<aeskey></aeskey>\n\t\t</appattach>\n\t\t<extinfo />\n\t\t<sourceusername>gh_44fc2ced7f87@app</sourceusername>\n\t\t<sourcedisplayname>腾讯云助手</sourcedisplayname>\n\t\t<thumburl>http://mmbiz.qpic.cn/mmbiz_png/ibdJpKHJ0IksRJXo4ib9nia65YNcIEibhQUONorXibKBoLBX7zqw3eVM6KibrCVPhgV8AeP9BTfSfiaM3s1c0ThQ0jbxA/640?wx_fmt=png&amp;wxfrom=200</thumburl>\n\t\t<md5 />\n\t\t<statextstr />\n\t\t<weappinfo>\n\t\t\t<username><![CDATA[gh_44fc2ced7f87@app]]></username>\n\t\t\t<appid><![CDATA[]]></appid>\n\t\t\t<type>1</type>\n\t\t\t<version>0</version>\n\t\t\t<weappiconurl><![CDATA[http://mmbiz.qpic.cn/mmbiz_png/ibdJpKHJ0IksRJXo4ib9nia65YNcIEibhQUONorXibKBoLBX7zqw3eVM6KibrCVPhgV8AeP9BTfSfiaM3s1c0ThQ0jbxA/640?wx_fmt=png&wxfrom=200]]></weappiconurl>\n\t\t\t<pkginfo>\n\t\t\t\t<type>0</type>\n\t\t\t\t<md5><![CDATA[]]></md5>\n\t\t\t</pkginfo>\n\t\t\t<wadynamicpageinfo>\n\t\t\t\t<shouldUseDynamicPage>0</shouldUseDynamicPage>\n\t\t\t\t<cacheKey><![CDATA[]]></cacheKey>\n\t\t\t</wadynamicpageinfo>\n\t\t\t<appservicetype>0</appservicetype>\n\t\t</weappinfo>\n\t</appmsg>"
    }

成功返回示例:

复制代码
    {
        "ret": 0,
        "msg": "success",
        "data": {
            "BaseResponse": {
                "ret": 0,
                "errMsg": {}
            },
            "Count": 1,
            "List": [
                {
                    "Ret": 0,
                    "ToUsetName": {
                        "string": "wxid_8pvkddddddt22"
                    },
                    "MsgId": 0,
                    "NewClientMsgid": 2950238266,
                    "Createtime": 1688092785,
                    "servertime": 1688092899,
                    "Type": 1,
                    "NewMsgId": 435902963537395300
                }
            ],
            "NoKnow": 0
        }
    }

错误返回示例:

复制代码
    {
        "ret": -1,
        "msg_err": "失败"
    }

发送消息

小提示:

  • 该接口可以发送文本和一些特殊类型消息
  • 注意:群里@某人时记得在at填写他的wxid以及在内容[Content]处填写[@他的昵称] 只是发送文本消息时MsgType填写1以及MsgSource为空

请求URL:

请求方式:

  • POST

请求头:

  • Content-Type:application/json

  • X-GEWE-TOKEN: 后台获取

参数:

参数名称 数据类型 必填 说明
appid string 设备id
to_wxid_list array 消息接收人的wxid/chatroomid
to_wxid_list.at array @接收者
to_wxid_list.content string 消息内容
to_wxid_list.msg_type string 消息类型
to_wxid_list.to_wxid string 私聊 接收者

返回数据:

参数名 数据类型 说明
ret number 0:成功
msg string 反馈信息
msg_err string 反馈错误信息
data object
type string 消息类型
ToUsetName string 接收者

请求参数示例:

复制代码
  {
    "appid": "wx_ECMY4oEDuQAP6WimpWwWv",
    "to_wxid_list": [
        {
            "at": [
                ""
            ],
            "content": "hhh",
            "msg_source": "",
            "msg_type": 1,
            "to_wxid": "wxid_8pvkddddddt22"
        }
    ]
}

成功返回示例:

复制代码
  {
    "ret": 0,
    "msg": "success",
    "data": {
        "BaseResponse": {
            "ret": 0,
            "errMsg": {}
        },
        "Count": 1,
        "List": [
            {
                "Ret": 0,
                "ToUsetName": {
                    "string": "zhandaddddd88"
                },
                "MsgId": 0,
                "NewClientMsgid": 3218469563,
                "Createtime": 1689922358,
                "servertime": 1689922360,
                "Type": 1,
                "NewMsgId": 8015075888668773694
            }
        ],
        "NoKnow": 0
    }
}
相关推荐
Gerardisite2 天前
如何在微信个人号开发中有效管理API接口?
java·开发语言·python·微信·php
winfredzhang8 天前
用 Python + wxPython 打造一个万能网页图片一键下载神器(附完整源码 + 详细解析)
python·微信·pdf·遍历·图片·网页·保存
旭日跑马踏云飞9 天前
一文搞定腾讯开发生态-微信上传图片和视频
微信·serverless
llq_3509 天前
如何用 GitHub Pages 完成企业微信的域名归属认证?(适合没有服务器的开发者)
微信
今天也在研究公众号10 天前
Apple同款SVG,怎么写出来?手写+编辑器,两张方法都能搞定!
微信
开发加微信:hedian11611 天前
短剧小程序开发全攻略:技术选型与实现思路
微信·小程序·架构·aigc·交互
AiXed12 天前
PC微信协议之nid算法
python·网络协议·算法·微信
sg_knight13 天前
微信小程序中 WebView 组件的使用与应用场景
前端·javascript·微信·微信小程序·小程序·web·weapp
悟空码字15 天前
微信小程序管理系统,代运营3600+医院小程序
微信·小程序·编程·软件开发