You can add a user to a group with the addUserToGroup method.

Permission to run the request: Account Owner, Administrator, Organization Administrator. 

 

Parameters

ParameterTypeDescription
credentials (required)credentialsRead the description of the Credentials object.
groupId (required)stringID of a group to which a given user will be added.
userId (required)stringID of a user to be added to a specified group.


Return Value

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

ParameterTypeDescription
successbool'True' if the user has been added to the group.


Possible Errors

ErrorDescription
Unknown userThe specified user hasn't been found.
Unknown groupThe specified group hasn't been found.
Permission deniedYou do not have permissions to edit the group.
User already group's memberThe given user already belongs to the specified group.
Wrong parametersThe system failed to process the request because it did not contain all necessary parameters.
Can't add user into group from another organizationYou are not allowed to add a user into a group from another organization.


Sample Call

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns="http://ispringlearn.com/go/services/api/soap">
 <SOAP-ENV:Body>
    <AddUserToGroupRequest>
      <credentials>
        <accountUrl>http://myaccount.ispringlearn.com</accountUrl>
        <email>email@email.com</email>
        <password>password</password>
      </credentials>
      <userId>1</userId>
      <groupId>2</groupId>
    </AddUserToGroupRequest>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML


Sample Response

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns="http://ispringlearn.com/go/services/api/soap">
  <SOAP-ENV:Body>
    <AddUserToGroupResult>
      <success>true</success>
    </AddUserToGroupResult>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML