Add/Update Group Members
Important Note
This feature is available in the Business plan. If you haven't upgraded yet, please upgrade before using this feature.
Before using this API, teams need to obtain the user_id first. There are two methods:
Method 1: After inviting members to join the team from the contacts page, obtain user_id through Get Member List
Method 2: Use Register User to create a third-party account and obtain user_id
API Overview
- Function: Add Member
- Request Method: POST
- Request URL: /api/contacts/teams/{team_id}/groups/{group_id}/users/{user_id}?appid={appid}&access_token={access_token}
Request Parameters
Parameter Name | Type | Required | Location | Description | Example |
---|---|---|---|---|---|
team_id | integer | Yes | uri | Team ID | 43 |
group_id | integer | Yes | uri | Group ID | 1923 (defaults to "root directory" when parameter is 0) |
user_id | integer | Yes | uri | User ID | 60000208205 |
openid | string | No | body | User's unique identifier in third-party platformOnly for partner platforms This field is identical to open_id , if both are specified, only openid takes effect | abcdefg |
open_id | string | No | body | User's unique identifier in third-party platformOnly for partner platforms This field is deprecated, please use openid | abcdefg |
role | integer | No | body | Role, subject to team member limit | 2:Team Admin;3:Survey Admin;4:Regular Member |
Response Parameters
None
Response Examples
- Successful Request
{
"code": "OK",
"error": {
"type": ""
},
"data": {},
"request_id": "10595b0f-9333-4ad7-8bda-ce2c00119758"
}
- Failed Request
{
"code": "InvalidArgument",
"error": {
"type": "invalid_param"
},
"data": {},
"request_id": "793fb149-4f12-4439-aa83-01d0e211b15c"
}
Error Codes
error.type Code | Description |
---|---|
contacts_user_existed | User Already Exists in Contacts |
contacts_team_not_found | Team Not Found |
contacts_group_not_found | Group Not Found |
contacts_user_not_found | User Not Found |
contacts_add_user_error | Failed to Add User |
invalid_argument | Invalid Parameter |
claim_error | No Permission |