Users

Activating a user after they’re created

When you create a user they’re assigned the PENDING status by default. To set their status to ACTIVE you follow the ‘user state machine’ rules:

  1. POST /users for user account creation. Capture the Location header value, which is the unique link to the user record. This is used in Step 2.
  2. GET /users/{id} for the user object.
  3. PUT /users/{id} with STATUS set to ‘INACTIVE’ using the user object retrieved in step 2.
  4. PUT /users/{id} with STATUS set to ‘ACTIVE’ using the user object retrieved in step 2.

Note: The status text is case sensitive. Lower case or mixed case text is invalid. Always use upper case. For example, active != ACTIVE; inActive != INACTIVE

  • JSON
  • XML

Activating an newly created user using the 'user state machine' rules

Follow these steps in the exact order:

 

Step 1

HTTP 1.1 POST https://api.<region>.whispir.com/users?apikey=<your_api_key>
Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk
x-api-key: your_api_key
{user object}

This step captures the Location header value.

 

Step 2

HTTP 1.1 GET https://api.<region>.whispir.com/users/{:id}?apikey=<your_api_key>
Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk
x-api-key: your_api_key

This step retrieves the newly created user object.

 

Step 3

HTTP 1.1 PUT https://api.<region>.whispir.com/users/{:id}?apikey=<your_api_key>
Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk
x-api-key: your_api_key
{userobject}
status : 'INACTIVE'

 

Step 4

HTTP 1.1 PUT https://api.<region>.whispir.com/users/{:id}?apikey=<your_api_key>
Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk
x-api-key: your_api_key 
{userobject}
status : 'ACTIVE'