Overview
Sends a chatroom message from your server. Supported message types include plain-text messages, images, audio, and more.
Request
Authentication Add authentication headers to the request. See Authentication
Method
POST
Rate limit
100 requests/second
Endpoint https://API domain/apigateway/messages/chatroom/send
Content-Type
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
sender_id | string | Yes | Sender ID. Maximum length: 32 characters. | |
target_ids | array | Yes | Chatroom IDs. Each ID can contain up to 32 characters. | |
msg_type | string | Yes | Message type identifier. Maximum length: 50 characters. | |
msg_content | string | Yes | Message content. JSON is recommended. |
Request Example
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\"}"
}
Response Parameters
| Parameter | Data Type | Description | |
|---|---|---|---|
| msg_id | string | Unique message identifier. |
Response Example
{
"code":0,
"msg":"sucess",
"data":[
{
"target_id":"chatroom1",
"msg_id":"aaaaaaa"
},
{
"target_id":"chatroom2",
"msg_id":"bbbbbbb"
}
]
}