发送文本消息2(sendText2)
# 接口说明
- 接口路径:http://127.0.0.1:8888/wechat/httpapi
- 请求方法:POST
- 功能描述:发送文本消息2,理论上没有最长消息限制,可以发送一次性发送很长的消息
# 微信版本支持情况
提示
❌ 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
# Body请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | string | 是 | 接口type |
| data | object | 是 | 请求数据对象 |
| data.wxid | string | 是 | 对方wxid,支持好友、群聊、公众号等 |
| data.msg | string | 是 | 消息内容,如果\n是两行,那么用\r试试 |
| data.compatible | string | 否 | 兼容模式,1=是,其他值或留空不启用。启用兼容模式企微就可以看到消息 |
# Body请求示例
{
"type": "sendText2",
"data": {
"wxid": "34457730396@chatroom",
"msg": "阿萨德[@,wxid=wxid_3sq4tklb6c3121,nick=阿,isAuto=true]\n测试[@,wxid=all,nick=阿萨德,isAuto=true] 你好\n \\uD83D\\uDE01测试[捂脸][奸笑]",
"compatible": "0"
}
}
# 响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| 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