User resource

Site users management - Add user to site

OVERVIEW


This method explains how to add a number of new users to the site.

 

When adding a single user to a site follow the first step below. When adding more than one user to a site the below two steps should be followed. 

Note: The getProgressiveKey call is covered in step 1 and is used further in the process.

Step 1:

Request URI

POST  /api/3/sites/{siteid}/users

Request Body

Please provide a User object for add user to site API  in the request body.

Request Parameters

 

Parameter Value Description
sendinvitation true/false (true is the default value) If set to true, the newly added user will be sent an invitation

siteid

integer To get a site ID call: Get site list API

 

Response

The API returns a 200 OK http response if successful, otherwise an error object and error code are returned

If a single user has been added successfully then the response will be as per below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<users>

    <user>

        <index>1</index>

        <userid>1805</userid>

        <email>testemail@highq.com</email>

        <status>Success</status>

        <statuscode>201</statuscode>

        <message>User added successfully</message>

    </user>

</users>

 

If more than one user has been added successfully then response will be as per below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<progressivekeyresponse>

    <progressivekey>zJ5IlSYyhJ_1500443110814</progressivekey>

    <progressivekeystatus>INPROGRESS</progressivekeystatus>

</progressivekeyresponse>

Step 2:

Purpose

Once step 1 has been called, the user progress status needs to be checked. This is done by using this API end point call.

 

Resource(API) EndPoint      Query Params       Form Params HTTP Method Request

XML
Response

XML
Response

Code
/progressivekeystatus/{progressivekey} 

 

 

POST   Response XML  

Sample request URL : /api/3/progressivekeystatus/zJ5IlSYyhJ_1500443110814

 

Response XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<progressivekeyresponse>

    <progressivekey>zJ5IlSYyhJ_1500443110814</progressivekey>

    <progressivekeystatus>INPROGRESS</progressivekeystatus>

</progressivekeyresponse>



When a user has been added successfully the response will be as per below: 



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<users>

    <user>

        <index>1</index>

        <userid>1805</userid>

        <email>testemail@highq.com</email>

        <status>Success</status>

        <statuscode>201</statuscode>

        <message>User added successfully</message>

    </user>

    <user>

        <index>2</index>

        <status>Failure</status>

        <statuscode>403</statuscode>

        <message>Invalid Email address</message>

    </user>

</users>

Assumption

- User will be added in site with the existing organisation only.

- If a user with the same email already exists in the site, a validation message will be displayed.

- Please note that if an existing system user is added to a site, then the request xml information such as firstname, lastname and orgid will not be updated. Only the system user will be added to site.

Comments


4 Comments

Last Updated: Jun 09,2023