跳到主要内容

功能说明​

会话设置免打扰后,当前会话不会接受离线消息推送,调用此接口后 IM 服务端会将 undisturb_type 自动同步到指定用户的各端。

请求说明​

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

请求类型:POST

请求限频:100次/秒

请求地址:https://请求域名/apigateway/convers/undisturb

Content-Type:application/json

请求参数​

参数数据类型是否必填参数说明
user_idstring是设置免打扰的用户id;最多 32 个字符
itemsarray是需要设置免打扰状态的会话列表
items[].target_idstring是会话 ID;最多 32 个字符
items[].channel_typeint是会话类型
items[].undisturb_typeint是免打扰类型:0:取消免打扰;1:普通会话免打扰

请求示例​

POST /apigateway/convers/undisturb HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json

{
"user_id":"userid1",
"items":[
{
"target_id":"userid2",
"channel_type":1,
"undisturb_type":1
},
{
"target_id":"groupid1",
"channel_type":2,
"undisturb_type":1
}
]
}

响应示例​

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