GroupResource Resource

RESTful Web Service Resource to manage groups and their members.

GET /api/rest/groups

Returns all groups. 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 Group (JSON)
application/xml list of group (XML)

Example

Request
GET /groups
Accept: application/json

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

                
[ {
  "creationDate" : 12345,
  "description" : "...",
  "lastModified" : 12345,
  "members" : [ "...", "..." ],
  "name" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
} ]
                
              

POST /api/rest/groups

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

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

Example

Request
POST /groups
Content-Type: application/json

                
{
  "creationDate" : 12345,
  "description" : "...",
  "lastModified" : 12345,
  "members" : [ "...", "..." ],
  "name" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
}
                
              
Response
HTTP/1.1 201 Created

              

DELETE /api/rest/groups/{id}

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

Request Parameters
name type description
id path the name of the group 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 /groups/{id}

              
Response
HTTP/1.1 204 No Content

              

GET /api/rest/groups/{id}

Fetches a group by its name or id. Note: This method requires admin privileges.

Request Parameters
name type description
id path the id/name of the group
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 Group (JSON) the Group with the specified id
application/xml group (XML)

Example

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

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

                
{
  "creationDate" : 12345,
  "description" : "...",
  "lastModified" : 12345,
  "members" : [ "...", "..." ],
  "name" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
}
                
              

PUT /api/rest/groups/{id}

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

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

Example

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

                
{
  "creationDate" : 12345,
  "description" : "...",
  "lastModified" : 12345,
  "members" : [ "...", "..." ],
  "name" : "...",
  "type" : "...",
  "properties" : [ {
    "key" : "...",
    "value" : "..."
  }, {
    "key" : "...",
    "value" : "..."
  } ]
}
                
              
Response
HTTP/1.1 204 No Content