Adding a User
You can add a user with the method: addUser.
Permission to run the request: Account Owner, Administrator, Organization Administrator.
Parameters
Parameter | Type | Description |
---|---|---|
credentials (required) | credentials | Read the description of the Credentials object. |
email (required) | string | Email of the new user. |
login(optional) | string | Login of the new user. |
password (optional) | string | Password of the new user. If it's not specified, the password will be generated automatically. |
organizationId (optional) | string | Organization ID the user will be added to. |
sendLoginEmail (optional, default: true) | bool | Parameter that determines whether an email is sent to the added user. |
invitationMessage (optional) | string | Text of an invitation message in the email. |
role (optional) | string | Assign a role to the new user: 10 - regular user, 20 - publisher, 30 - organization admin 40 - account admin |
groups (optional) | string[] | An array with the IDs of the groups the user will be added to. |
Return Value
After the request has been completed, the system returns an object with the following properties:
Parameter | Type | Description |
---|---|---|
userId | string | ID of the added user. |
exceededGroups | string[] | An array of group IDs the user hasn't been added to due to the exceeded user limit. |
Possible Errors
Error | Description |
---|---|
User with the same email is already registered. | A user with the specified e-mail address already exists. |
User with the same login is already registered. | A user with the specified e-mail address already exists. |
Number of user accounts is exceeded | A user hasn't been added because the number of user accounts supported by your subscription plan has been exceeded. |
Permission denied | An authorized user does not have enough permissions to handle the operation. For example, an organization admin can't add users to another organization. |
Wrong parameters | Some of the sent parameters are incorrect. |
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>
<AddUserRequest>
<credentials>
<accountUrl>http://myaccount.ispringlearn.com</accountUrl>
<email>email@email.com</email>
<password>password</password>
</credentials>
<email>user@email.com</email>
<password>password</password>
<sendLoginEmail>true</sendLoginEmail>
<invitationMessage>Message</invitationMessage>
<role>20</role>
<groups>
<id>1</id>
<id>2</id>
</groups>
</AddUserRequest>
</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>
<AddUserResult>
<userId>1</userId>
<exceededGroups />
</AddUserResult>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML