(Quick Reference)
Service: Save a user
Description: This web service is used to add a new user object to the database
URL:
https://BASE_URL/api/VERSION/users
Method: POST
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
email | | String | Yes | |
password | | String | Yes | |
enabled | By default, it is set to true | boolean | no | |
employeeId | The ID of employee | Long/String | yes | |
sendEmail | notify the new user | boolean | no | |
useExternalId | By default, it is set to false. set it to true if you want to use external ids. | Boolean | no | true , false |
Success Output
Success case: response.status=201
{
"id": 3,
"email": "foobar@example.com",
"firstName": "John",
"lastName": "Doe",
"reference": "Ref-01",
"employee": {
"id": 3,
"href": "/api/v2.0/employees/3"
},
"enabled": true,
"organization": "entity1",
"dateCreated": "2017-01-18T17:18:36Z",
"lastUpdated": "2017-02-16T17:59:09Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "missing_param",
"error_description": "email parameter is missing"
}
{
"error": "not_unique",
"error_description": "email already used."
}
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The employee with the id 1254 doesn't exist."
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}