You can make a user active or inactive with the changeUserStatus method.

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

 

Parameters

Parameter
Type
Description
credentials (required)credentialsRead the description of the Credentials object.
userId (required)stringID of the user whose profile you want to update.
status (required)string

Specify user status:

1 - active

3 - inactive

deactivationDate (optional)dateTime

Date formatted according to ISO8601 (YYYY-MM-DD).

Example: 2017-11-27


To set the deactivation date, send '1' as the 'status' parameter. 

If you send the request without a deactivation date, any previously entered date will be disregarded.

Return Value

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

Parameter
Type
Description
successboolTrue if the user's profile has been updated.

Possible Errors

TypeDescription
Unknown userA user with the specified ID was not found.
Permission deniedA user does not have enough permissions to handle the operation. For example, an organization admin can't add users to another organization.
User status must be 1 or 3, <status> givenUnacceptable status.
Deactivation date must be in a format YYYY-MM-DDDeactivation date must be in the format YYYY-MM-DD.

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>
    <ChangeUserStatusRequest>
      <credentials>
        <accountUrl>http://myaccount.ispringlearn.com</accountUrl>
        <email>email@email.com</email>
        <password>password</password>
      </credentials>
      <userId>1</userId>
      <status>1</status>
      <deactivationDate>2017-11-27</deactivationDate>
    </ChangeUserStatusRequest>
  </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:ns1="http://ispringlearn.com/go/services/api/soap">
  <SOAP-ENV:Body>
    <ns1:successResult>
      <ns1:success>true</ns1:success>
    </ns1:successResult>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML