Overview
Sends the same message to multiple conversations in a single request. Groupcast messages do not affect the sender’s conversation-list ordering, but they do affect recipient conversation-list ordering. For the sender, groupcast message history is stored separately and aggregated by target_id into a conversation that contains only sent messages. The API sends the message on behalf of sender_id to each conversation in target_convers, supporting private chats and group chats.
target_convers supports multiple conversations. Messages to individual conversations are sent at intervals of 50ms; requests with more conversations take longer to complete.
Request
Authentication Add authentication headers to the request. See Authentication
Method
POST
Rate limit
100 requests/second
Endpoint https://API domain/apigateway/messages/groupcast/send
Content-Type
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
sender_id | string | Yes | Sender ID. Maximum length: 32 characters. | |
| target_id | string | No | Groupcast target ID. Groupcast message history with the same ID is aggregated. If omitted, no groupcast conversation is created for the sender. Maximum length: 32 characters. | |
msg_type | string | Yes | Message type identifier. Maximum length: 50 characters. | |
msg_content | string | Yes | Message content. JSON is recommended. | |
| target_convers | array | Yes | Target conversations for the groupcast. Supports private chats and group chats. | |
| target_convers[].target_id | string | Yes | Target conversation ID. Maximum length: 32 characters. | |
| target_convers[].channel_type | int | Yes | Target conversation type. 1: private chat; 2: group chat. |
Request Example
POST /apigateway/messages/groupcast/send HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json
{
"sender_id":"userid1",
"target_id":"groupcastid1",
"msg_type":"text",
"msg_content":"{\"content\":\"aabbcc\"}",
"target_convers":[
{
"target_id":"userid2",
"channel_type":1
},
{
"target_id":"groupid1",
"channel_type":2
}
]
}
Response Example
{
"code":0,
"msg":"sucess"
}