Skip to main content

功能说明

群发消息功能,一次性向多个会话发送消息内容,群发消息不影响发送方的会话列表排序,影响接收方的会话列表排序,对于消息发送者,会单独记录群发消息历史,按target_id 汇聚,单独形成会话,此会话只包含发送方的消息。根据 target_convers,分别以 sender_id 身份向每个会话发送消息,支持 单聊群聊

特殊限频

target_convers 支持多个会话,每个会话间隔发送时间为 50ms,会话越多发送耗时越长,返回时间越长

请求说明

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

请求类型POST

请求限频100次/秒

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

Content-Typeapplication/json

请求参数

参数数据类型是否必填参数说明
sender_idstring消息发送者id
target_idstring群发目标id,id相同的群发历史消息会汇聚在一起,这个参数为空时,将不为发送者生成此会话
msg_typestring消息类型标识
msg_contentstring消息内容,建议json格式
target_conversarray群发的目标会话,支持单聊和群聊

请求示例

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
}
]
}

响应示例

{
"code":0,
"msg":"sucess"
}