跳转到主要内容
POST
/
channel
/
subscriber_remove
curl -X POST "http://localhost:5001/channel/subscriber_remove" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "group123",
    "channel_type": 2,
    "subscribers": ["user4", "user5"],
    "temp_subscriber": 0
  }'
{
  "status": "ok"
}

概述

从频道移除订阅者(成员),支持批量移除操作。

请求体

channel_id
string
required
频道 ID
channel_type
integer
required
频道类型
  • 1 - 个人频道
  • 2 - 群组频道
subscribers
array
required
要移除的订阅者用户 ID 列表
subscribers[]
string
用户 ID
temp_subscriber
integer
default:0
是否为临时订阅者
  • 0 - 永久订阅者
  • 1 - 临时订阅者
curl -X POST "http://localhost:5001/channel/subscriber_remove" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "group123",
    "channel_type": 2,
    "subscribers": ["user4", "user5"],
    "temp_subscriber": 0
  }'
{
  "status": "ok"
}

响应字段

status
string
required
操作状态,成功时返回 "ok"

状态码

状态码说明
200订阅者移除成功
400请求参数错误
403没有操作权限
404频道不存在或用户不在频道中
500服务器内部错误

参数说明

临时订阅者 (temp_subscriber)

类型说明影响
0永久订阅者移除正式成员完全移除成员关系
1临时订阅者移除临时成员移除临时访问权限

使用场景

群组管理

  • 踢出成员:群主或管理员移除违规成员
  • 成员退群:用户主动退出群组
  • 批量清理:清理不活跃或无效的成员