You can add a user to a group with the addUserToGroup method.
Permission to run the request: Account Owner, Administrator, Organization Administrator.
Parameters
Parameter | Type | Description |
---|
credentials (required) | credentials | Read the description of the Credentials object. |
groupId (required) | string | ID of a group to which a given user will be added. |
userId (required) | string | ID 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:
Parameter | Type | Description |
---|
success | bool | 'True' if the user has been added to the group. |
Possible Errors
Error | Description |
---|
Unknown user | The specified user hasn't been found. |
Unknown group | The specified group hasn't been found. |
Permission denied | You do not have permissions to edit the group. |
User already group's member | The given user already belongs to the specified group. |
Wrong parameters | The system failed to process the request because it did not contain all necessary parameters. |
Can't add user into group from another organization | You 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