Skip to main content
Version: latest

添加/修改分组成员

团队使用该接口前,需要提前获得用户的 user_id,有两种方法:
方法1: 从通讯录页面邀请成员加入团队后,通过获取成员列表 获得 user_id
方法2: 使用注册用户创建一个第三方账号,获得 user_id

接口概述#

  • 功能:添加成员
  • 请求方式:POST
  • 请求地址:/api/contacts/teams/{team_id}/groups/{group_id}/users/{user_id}?appid={appid}&access_token={access_token}

请求参数#

参数名类型必须参数位置描述示例值
team_idintegeruri团队ID43
group_idintegeruri分组ID1923 参数为0时默认添加到“根目录”
user_idintegeruri用户ID60000208205
openidstringbody用户在第三方平台的唯一标识
仅合作平台可用
该字段与 open_id 一致,如果同时指定仅 openid 生效
abcdefg
open_idstringbody用户在第三方平台的唯一标识
仅合作平台可用
该字段废弃,请使用 openid
abcdefg
roleintegerbody角色,受团队可用人数限制2:团队管理员;3:问卷管理员;4:普通成员

响应参数#

响应示例#

  • 请求成功
{    "code": "OK",    "error": {        "type": ""    },    "data": {},    "request_id": "10595b0f-9333-4ad7-8bda-ce2c00119758"}
  • 请求失败
{    "code": "InvalidArgument",    "error": {        "type": "invalid_param"    },    "data": {},    "request_id": "793fb149-4f12-4439-aa83-01d0e211b15c"}

错误码#

error.type 错误代码错误描述
contacts_user_existed用户已存在于通讯录
contacts_team_not_found团队不存在
contacts_group_not_found分组不存在
contacts_user_not_found用户不存在
contacts_add_user_error添加用户失败
invalid_argument参数错误
claim_error无权限