🚨发送各种消息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=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

Last updated