发送XML(sendXml)
# 接口说明
- 接口路径:http://127.0.0.1:7777/qianxun/httpapi
- 请求方法:POST
- 功能描述:发送XML,XML里
wxid_nq6r0w9v12612 必须为自己的wxid,切记
# 微信版本支持情况
提示
✅ 3.9.9.34
✅ 3.9.10.16
✅ 3.9.11.18
✅ 3.9.12.16
✅ 3.9.12.44
✅ 3.9.12.54
✅ 3.9.12.56
# Query请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| safekey | string | 否 | 安全秘钥,未设置的话则不需要传 |
| wxid | string | 是 | 要使用哪个微信机器人的wxid |
# Body请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | string | 是 | 接口type |
| data | object | 是 | 请求数据对象 |
| data.wxid | string | 是 | 对方wxid,支持好友、群聊、公众号等 |
| data.xml | string | 是 | 任意xml,例如发送名片推荐、小程序等 |
| data.path | string | 否 | 图片本地路径或者网络直链 |
| data.type | string | 是 | 类型,可空,留空则自动使用xml里的type |
# Body请求示例
{
"type": "sendXml",
"data": {
"wxid": "34457730396@chatroom",
"xml": "<?xml version=\"1.0\"?><msg><appmsg appid=\"\" sdkver=\"0\"><title>哈咯</title><username /><action>view</action><type>33</type><showtype>0</showtype><content /><contentattr>0</contentattr><androidsource>3</androidsource><sourceusername>gh_6506303a12bb@app</sourceusername><sourcedisplayname>点我进入饿了么</sourcedisplayname><commenturl /><thumburl></thumburl><weappinfo><username>gh_6506303a12bb@app</username><version>4</version><pagepath><![CDATA[pages/index/index.html]]></pagepath><type>2</type><appservicetype>0</appservicetype></weappinfo><statextstr /><websearch /></appmsg><fromusername>wxid_nq6r0w9v12612</fromusername><scene>0</scene><appinfo><version>1</version><appname></appname></appinfo></msg>",
"path": "C:\\Users\\13301\\Desktop\\1.png"
}
}
# 响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| code | integer | 响应码 |
| msg | string | 响应消息 |
| wxid | string | 微信ID |
| port | integer | 端口 |
| pid | integer | 进程ID |
| flag | string | 标志 |
| timestamp | string | 时间戳 |
| result | object | 结果对象 |
| result.sendId | string | 发送ID |
# 响应示例
{
"code": 200,
"msg": "操作成功",
"result": {
"sendId": "cb3594ac3e35abd17914695850a6eb17"
},
"wxid": "wxid_nq6r0w9v12612",
"port": 7628,
"pid": 27544,
"flag": "7643",
"timestamp": "1741015593840"
}
上次更新: 2025/10/07, 20:52:02