🤢发送各种消息API
发送文本消息
POST
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendMsg&timeout=10&wxid=wxid_xxxxxxx
POST JSON
{"ToUserName":"5607240817@chatroom","Content":"你好","MsgType":1,"AtUsers":""}
{"ToUserName":"5607240817@chatroom","Content":"@机器人 你好","MsgType":1,"AtUsers":"wxid_xxxxxxx"} @某人 单一AT AT某人必须包含默认的昵称才可以触发客户端的提醒
AT所有人 Content必须包含@所有人
{"ToUserName":"5607240817@chatroom","Content":"@所有人 你好","MsgType":1,"AtUsers":"notify@all"}
发送APP消息
POST
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendAppMsg&timeout=10&wxid=wxid_xxxxxxx
POST JSON
{"ToUserName":"5607240811@chatroom","Content":"<appmsg>xxxx</appmsg>","MsgType":49}
注意转义 XML内容从appmsg这个节点开始
发送图片
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendImage&timeout=10&wxid=wxid_xxxxxxx
POST JSON {"ToUserName":"5607240817@chatroom","ImagePath":"./running.png"} //发送本地图片
{"ToUserName":"5607240817@chatroom","ImageUrl":"http://wwww.www.ww/1.jpg"} //发送网络图片
{"ToUserName":"5607240817@chatroom","ImageBase64":"Base64编码图片"} //发送Base64编码图片
发送语音
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendVoice&timeout=10&wxid=wxid_xxxxxxx
POST JSON
{"ToUserName":"5607240817@chatroom","VoicePath":"./running.silk"} //发送本地语音
{"ToUserName":"5607240817@chatroom","VoiceUrl":"http://wwww.www.ww/1.silk"} //发送网络语音
发送表情 通过MD5发送
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendEmoji&timeout=10&wxid=wxid_xxxxxxx
POST JSON
{"ToUserName":"5607240817@chatroom","EmojiMd5":"aa567de4eb86b5d589d394ad489bcfd7","EmojiLen:123}
转发CDN图片
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendCdnImage&timeout=10&wxid=wxid_xxxxxxx
POST JSON
{"ToUserName":"5607240817@chatroom","XmlStr":"<msg>传入XML CDN信息</msg>"}
注意转义 自行转义一下 CDNXML信息从<msg>节点开始
发送个人名片
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendMsg&timeout=10&wxid=wxid_xxxxx
POST JSON
{"ToUserName":"22338810507@chatroom","Content":"个人名片XML","MsgType":42,"AtUsers":""}
XML 需要转义
<msg bigheadimgurl=\"http://wx.qlogo.cn/mmhead/ver_1/A3EqIaaiaXWZTdLIibLZNdwlAB1JynRAuhPTO44S84487nBTxrQXp7nAd6ohiaicgWdErfPcu4FvFM1YIA9wzaLKeb8f47ibq47gU9Plh7XTWvk4/0\" smallheadimgurl=\"http://wx.qlogo.cn/mmhead/ver_1/A3EqIaaiaXWZTdLIibLZNdwlAB5JynRAuhPTO44S84487nBTxrQXp7nAd6ohiaicgWdErfPcu4FvFM1YIA9wzaLKeb8f47ibq47gU9Plh7XTWvk4/132\" username=\"v3_020b3826fd030200000000009ac816440135f5000000501ea9a3dba12f95f6b60a0536a1adb6d1126cff82b1e1abc8f7fa9e98c839a700533f9f1dadf93c68546bc29157167e1480f423b707b41ee831777394b2e52f7174b8430dfc8ee47674f92b@stranger\" nickname=\"0rigin\" fullpy=\"origin\" shortpy=\"\" alias=\"\" imagestatus=\"4\" scene=\"17\" province=\"河\" city=\"中国大陆\" sign=\"\" sex=\"1\" certflag=\"0\" certinfo=\"\" brandIconUrl=\"\" brandHomeUrl=\"\" brandSubscriptConfigUrl=\"\" brandFlags=\"0\" regionCode=\"CN_Henan_Bnyang\" antispamticket=\"v4_000b908f0b04000001000000000076658b2b441e90552d584e97ad611000000050ded0b020927e3c97896a09d47e6e9e4f4813cb69c7863e4871dc7dda8a2f36b4bb90ad616a0857a4a8f7361db8deb0d004626dce8ab0bc944d4e0818cc70608494516e58aab62192f9c6b4139d221490770e24e63857828035b54dae26a96347864340d49df8295943b650ec52892bba2614711cb0e295ef75fe6724db69f7c42c2e73ffb1108c657960bba10036007e7b93decef056a079f23b4b870082ef38f4adf49a64860088ee51fa12620b304225b160b037d88e3b7d9a402c109d470bbcdcf8a44cc302c3d2b4796e6d6105edfe588082282fe88c6cb9594343e182b9e62acd98cd0b79@stranger\" />
转发小视频消息
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=SendVideo&timeout=10&wxid=wxid_xxxxx
POST JSON
{"ToUserName":"7188154792@chatroom","VideoXml":"<msg>xxxxx</msg>"}
Video CDN 信息自行转义
下载语音消息
http://127.0.0.1:8898/v1/LuaApiCaller?funcname=DownloadVoice&timeout=10&wxid=wxid_xxxxx
{"SavePath":"123.arm","VoiceXml":"<msg>xxxxx</msg>","MsgId":1128731679}
Voice CDN 信息自行转义 MsgId 为推送参数结构里的MsgI
最后更新于