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

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

发送app类型消息

小提示:
  • 发送一些特殊的消息类型
  • 注意参数
请求URL:
  • http://域名地址/api/message/sendapp
请求方式:
  • POST
请求头:
  • Content-Type:application/json

  • X-GEWE-TOKEN: 后台获取

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

返回数据:
参数名数据类型说明
retnumber0:成功
msgstring反馈信息
msg_errstring反馈错误信息
dataobject
List.ToUsetNameobject对方用户
List.MsgIdNumber消息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:
  • http://域名地址/api/message/sendmsg
请求方式:
  • POST
请求头:
  • Content-Type:application/json

  • X-GEWE-TOKEN: 后台获取

参数:
参数名称数据类型必填说明
appidstring设备id
to_wxid_listarray消息接收人的wxid/chatroomid
to_wxid_list.atarray@接收者
to_wxid_list.contentstring消息内容
to_wxid_list.msg_typestring消息类型
to_wxid_list.to_wxidstring私聊 接收者
返回数据:
参数名数据类型说明
retnumber0:成功
msgstring反馈信息
msg_errstring反馈错误信息
dataobject
typestring消息类型
ToUsetNamestring接收者

请求参数示例:

  {
    "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
    }
}

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

iPad协议个微协议

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值