Page tree
Skip to end of metadata
Go to start of metadata

Request: POST /group/{group_id}/members

Permissions to Run the Request

Account Owner, Account Administrators, Department Administrators, or custom roles

Request Headers

Header

Description

X-Auth-Account-Url (required)The base URL of the account, e.g. http://myaccount.ispringlearn.com.
X-Auth-Email (required)The login of Account OwnerAccount AdministratorDepartment Administrator, or a user with a role with custom settings allowing them to replace group users.
X-Auth-Password (required)The password of Account OwnerAccount AdministratorDepartment Administrator, or a user with a role with custom settings allowing them to replace group users.
ParameterDescription
group_id (required)The ID of a group whose users you want to replace.

The users whose IDs are indicated in the method will completely replace existing group members. That means that an empty userIds parameter sent within the method will remove all users from the group. If two user IDs are sent, all previous groups members will be deleted from the group and two new participants will be added.

Important: 

Let's say, a Department Administrator or a user with a role with custom settings allowing them to replace group users sends a list of new users which should be added to the group. There are already some users in the group, both from departments the sender manages and from departments the sender doesn't have access to. 

After the method is performed, all new users sent within the method will be added to the group. But concerning existing members, only users from the departments the sender manages and their daughter departments will be removed. 

Participants who belong to the departments which aren't managed by the sender will remain in the group.


Response Codes

Code

Text

Description

200Successful operationUsers replacement was successfully completed.
400Bad RequestA request error.
401UnauthorizedAn authorization error.
403Permission deniedThe user doesn't have enough permissions to replace group users.

Sample Request

POST /group/b1496214-acab-11e9-8db0-120a62f268a9/members HTTP/1.1
Host: api-learn.ispringlearn.com
X-Auth-Account-Url: http://myaccount.ispringlearn.com
X-Auth-Email: email@email.com
X-Auth-Password: password
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8"?>
<request>
	<userIds>
		<id>3fa85f64-5717-4562-b3fc-2c963f66afa6</id>
        <id>16b113ea-e2e9-11e9-87d9-aa9d91baa591</id>
	</userIds>
</request>

Sample Response

HTTP/1.1 200 Successful operation
Connection: close
  • No labels