UserResource Resource

RESTful Web Service Resource to manage users.

GET /api/rest/users

Returns all users. Note: This method requires admin privileges.

Request Parameters
name type description default constraints
desc query sort direction desc or aesc false boolean
limit query the limit value for paging -1 int
sortby query sort parameter    
start query the start value for paging 0 int
Response Codes
code condition
200 success
403 forbidden, the current user has no admin privileges
500 internal server error
Response Body
media type data type
application/json array of User (JSON)
application/xml list of user (XML)

Example

Request
GET /users
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "active" : true,
  "admin" : true,
  "creationDate" : 12345,
  "displayName" : "...",
  "lastModified" : 12345,
  "mail" : "...",
  "name" : "...",
  "password" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
} ]
                
              

POST /api/rest/users

Creates a new user. Note: This method requires admin privileges.

Request Body
media type data type description
application/json User (JSON) the user to be created
application/xml user (XML)
Response Codes
code condition
201 create success
403 forbidden, the current user has no admin privileges
500 internal server error

Example

Request
POST /users
Content-Type: application/json

                
{
  "active" : true,
  "admin" : true,
  "creationDate" : 12345,
  "displayName" : "...",
  "lastModified" : 12345,
  "mail" : "...",
  "name" : "...",
  "password" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
}
                
              
Response
HTTP/1.1 201 Created

              

DELETE /api/rest/users/{id}

Deletes a user. Note: This method requires admin privileges.

Request Parameters
name type description
id path the name of the user to delete.
Response Codes
code condition
204 delete success
403 forbidden, the current user has no admin privileges
500 internal server error

Example

Request
DELETE /users/{id}

              
Response
HTTP/1.1 204 No Content

              

GET /api/rest/users/{id}

Returns a user. Note: This method requires admin privileges.

Request Parameters
name type description
id path the id/name of the user
Response Codes
code condition
200 success
403 forbidden, the current user has no admin privileges
404 not found, no group with the specified id/name available
500 internal server error
Response Body
media type data type description
application/json User (JSON) the User with the specified id
application/xml user (XML)

Example

Request
GET /users/{id}
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "active" : true,
  "admin" : true,
  "creationDate" : 12345,
  "displayName" : "...",
  "lastModified" : 12345,
  "mail" : "...",
  "name" : "...",
  "password" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
}
                
              

PUT /api/rest/users/{id}

Modifies the given user. Note: This method requires admin privileges.

Request Parameters
name type description
id path name of the user to be modified
Request Body
media type data type description
application/json User (JSON) user object to modify
application/xml user (XML)
Response Codes
code condition
204 update success
403 forbidden, the current user has no admin privileges
500 internal server error

Example

Request
PUT /users/{id}
Content-Type: application/json

                
{
  "active" : true,
  "admin" : true,
  "creationDate" : 12345,
  "displayName" : "...",
  "lastModified" : 12345,
  "mail" : "...",
  "name" : "...",
  "password" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
}
                
              
Response
HTTP/1.1 204 No Content