AVAILABLE WITH BUSINESS SUBSCRIPTION

Method: updateGroupMembers

Permissions to Run the Request

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

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.

Parameters

ParameterTypeDescription
token (required)stringAccess token. You can obtain a token by making a request.
groupId (required)string

The ID of the group whose users will be replaced. 

name (optional)string

The name of the group.

userIds (required)array

The ID of the users who will be added to the group.


Return Value

After the request has been completed, the system returns an object with the following properties

ParameterTypeDescription
successboolTrue if users have been successfully replaced.

Possible Errors

TypeDescription
Permission deniedThe user has no permissions to replace users in the group
Wrong ParametersThe system failed to process the request because it did not contain all necessary parameters

Sample Request

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
                   xmlns="https://ispringlearn.com/go/services/api/soap">
  <SOAP-ENV:Body>
      <UpdateGroupMembersRequest>
         <credentials>
           <token>p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE</token>
         </credentials>
         <groupId>24d1abde-e063-11e9-b2cf-0a580af40a22</groupId>
         <userIds>
            <id>95385f4e-e031-11e9-a9da-0a580af40b0f</id>
	        <id>cfe9248a-deb4-11e9-979c-0a580af40764</id>
            <id>d030ff3a-deb4-11e9-b26a-0a580af40764</id>
            <id>d07ba5f8-deb4-11e9-a6de-0a580af40764</id>
         <userIds>
      </UpdateGroupMembersRequest>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
                   xmlns="https://new.webservice.namespace">
  <SOAP-ENV:Body>
    <UpdateGroupMembersResult>
      <success>true</success>
    </UpdateGroupMembersResult>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML