Skip to main content

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.

Special Rate Limit

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

ParameterData TypeRequiredDescription
sender_idstringYesSender ID. Maximum length: 32 characters.
target_idstringNoGroupcast 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_typestringYesMessage type identifier. Maximum length: 50 characters.
msg_contentstringYesMessage content. JSON is recommended.
target_conversarrayYesTarget conversations for the groupcast. Supports private chats and group chats.
target_convers[].target_idstringYesTarget conversation ID. Maximum length: 32 characters.
target_convers[].channel_typeintYesTarget 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"
}