(Quick Reference) Service: Save an authority

Description: This web service is used to add a new authority object to the database

URL:

https://BASE_URL/api/VERSION/authorities

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
namethe name of the new authorityStringYes 

Success Output

Success case: response.status=201
{
    "id": 11,
    "name": "CEO",
    "dateCreated": "2016-09-09T08:18:51Z",
    "lastUpdated": "2016-09-09T08:18:51Z"
}

Failure Output

Failure case:response.status = 400
{
    "error": "missing_param",
    "error_description": "name parameter is missing"
}
{
  "error": "already_existing",
  "error_description": "Authority is already existing."
}

{
     "error": "save_failed",
     "error_description": "Failed to save instance"
}
Failure case:response.status = 500
{
     "error": "server_error",
     "error_description": "Oops! Something went wrong..."
}