发送音乐分享(sendMusic)
# 接口说明
- 接口路径:http://127.0.0.1:7777/qianxun/httpapi
- 请求方法:POST
- 功能描述:发送音乐分享
# 微信版本支持情况
提示
✅ 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.name | string | 是 | 歌曲名 |
| data.author | string | 是 | 作者 |
| data.app | string | 是 | 小尾巴,例如:酷狗/wx79f2c4418704b4f8,网易云/wx8dd6ecd81906fd84,QQ音乐/wx5aa333606550dfd5 |
| data.jumpUrl | string | 是 | 点击后跳转地址(微信改版,该参数已经无意义) |
| data.musicUrl | string | 是 | 音乐直链 |
| data.imageUrl | string | 是 | 封面图片直链 |
# Body请求示例
{
"type": "sendMusic",
"data": {
"wxid": "34457730396@chatroom",
"name": "岛屿",
"author": "忆白",
"app": "wx8dd6ecd81906fd84",
"jumpUrl": "https://music.163.com/#/outchain/2/1851471702/",
"musicUrl": "https://m10.music.126.net/20240524220753/0afc76cedf25edcceb927df94fd790b2/ymusic/060e/0552/515b/1dba6f94c2281e06ea53f12bf9492905.mp3",
"imageUrl": "http://p2.music.126.net/5QqPaUiTnTVxB5dZxDX3_Q==/109951165266634946.jpg?param=90y90"
}
}
# 响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| 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