统一走 /msg/*。给外部群发消息时,toId 填群 ID;给个人发,toId 填对方 ID。
{
"method": "/msg/sendText",
"params": { "guid": "<guid>", "toId": "<toId>", "content": "hello", "isNoNeedRead": false }
}{
"method": "/msg/sendLink",
"params": { "guid": "<guid>", "toId": "<toId>", "title": "标题", "desc": "描述", "linkUrl": "https://example.com", "iconUrl": "https://example.com/icon.png" }
}| method | 主要 params |
|---|---|
/msg/sendImage |
guid, toId, 图片文件元数据(fileId/fileAesKey/fileMd5/fileSize) |
/msg/sendVideo |
guid, toId, 视频文件元数据 + 时长 |
/msg/sendFile |
guid, toId, 文件元数据 |
/msg/sendWeapp |
guid, toId, appId, title, pagePath, 封面等 |
/msg/revokeMsg |
guid, chatId, msgServerId |
图片 / 视频 / 文件类消息需先通过云存储
/cloud/*上传、拿到文件元数据,再发送。完整字段以在线文档为准。