Skip to content

创建群组

创建一个新群组。调用者自动成为群主,初始成员通过 member_ids 指定,所有成员 ID 须已存在于系统中。

项目 内容
方法 POST
URL https://devapi.fengshengshou.com/api/groups
鉴权 是,需在请求头携带 Token
参数名 类型 必填 说明
name string 群组名称,最长 100 个字符
member_ids int[] 初始成员用户 ID 数组,所有 ID 须在系统中存在
description string 群组描述,最长 500 个字符
Terminal window
curl -X POST "https://devapi.fengshengshou.com/api/groups" \
-H "Authorization: Bearer your_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "研发团队",
"member_ids": [2, 3, 4],
"description": "研发部门内部讨论群"
}'
字段 类型 说明
code int 状态码,0 表示成功
message string 提示信息
data.id int 新创建的群组 ID
data.conversation_id int|null 关联会话 ID,可为空
{
"code": 0,
"message": "success",
"data": {
"id": 8,
"conversation_id": 120
}
}
{
"code": 422,
"message": "name 字段不能为空",
"data": null
}