Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.07 KB

File metadata and controls

33 lines (25 loc) · 1.07 KB

消息接口

统一走 /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/* 上传、拿到文件元数据,再发送。完整字段以在线文档为准。