Skip to main content

功能说明

开发者在服务端发送聊天室消息,支持发送普通文本图片语音 等消息类型。

请求说明

请求鉴权:接口需要增加验证 Header,请查看 鉴权说明

请求类型POST

请求限频100次/秒

请求地址:https://请求域名/apigateway/messages/chatroom/send

Content-Typeapplication/json

请求参数

参数数据类型是否必填参数说明
sender_idstring消息发送者id
target_idsarray聊天室id列表
msg_typestring消息类型标识
msg_contentstring消息内容,建议json格式

请求示例

POST /apigateway/messages/chatroom/send HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json

{
"sender_id":"userid1",
"target_ids":["chatroom1","chatroom2"],
"msg_type":"text",
"msg_content":"{\"content\":\"aabbcc\"}"
}

响应参数

参数数据类型参数说明
msg_idstring消息的唯一标识

响应示例

{
"code":0,
"msg":"sucess",
"data":[
{
"target_id":"chatroom1",
"msg_id":"aaaaaaa"
},
{
"target_id":"chatroom2",
"msg_id":"bbbbbbb"
}
]
}