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
<?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.
Fernando Deleon sorry I was on holiday so could not get back to you on this issue. Did you manage to get this issue sorted? if not can you please raise this with the support at support@highq.com as it seems to be a bug which the technical team will need to investigate. Thanks
Hi Imran Aziz
I have been playing with the creation of users now that i got access to create organisations.
I am sending the following xml request to the API
Notice am sending the same orgid for each one of the users.
As expected I then get a progressive key response
{
"progressivekey":"oKP6QOggUf_1533188870344",
"siteid":null,
"progressivekeystatus":"INPROGRESS",
"userid":null,
"responsebody":null,
"message":null,
"messagecode":null,
"integrationResponseDBO":null,
"error":null,
"downloadlink":null
}
I then query the progressivekeystatus endpoint every 3 seconds to check for the status
I then get a result back from the progressivekeystatus endpoint like such
{
"user":[
{
"index":1,
"status":"Failure",
"statuscode":"403",
"message":"Invalid Organization"
},
{
"index":2,
"userid":340,
"email":"sheep3@test.com.au",
"status":"Success",
"statuscode":"201",
"message":"User added successfully"
},
{
"index":3,
"userid":341,
"email":"fish3@test.com.au",
"status":"Success",
"statuscode":"201",
"message":"User added successfully"
}
]
}
As you can see i get a failure index 1 (user parrot) as you can see when i send my request the user parrot3 uses the same orgid as the other two, however the other two users have been added successfully.
Am a bit confuse if there is an issue
Thanks
Fernando
Fernando Deleon I am afraid we do not have any organisation API's in API version 3, the organisation API's have been developed in Collaborate 4.4 due to release soon and the API version for that is API version 4. The only way to get existing organisation ID's at the moment is to call get all system users API and extract existing organisation details from that.
Hi, So am wanting to add a new user to an existing group.
I understand that first i need to call this API then i use the userid to add it to the group.
However one of the require fields when i post is orgid
eg
my request body
Where do i get the orgid? or how do i create an organisation? what API can i use to create the org to get an org id?
Comments
4 Comments