UserGroups API
Scheme
Make sure you use the correct schema. Some environments will change the request type to GET if HTTP is used where HTTPS is required.
Creating a UserGroup
A usergroup is created by sending a POST request
/api/userGroups
using content-type JSON.
The body must contain the following mandatory fields:
- name
- memberIds
Success is indicated by status code 201. The objected request is returned with its unique identifier.
Failure due to a badly formed user request returns an empty body and status code 400.
Request:
POST /api/userGroups
Content-Type: application/json
Body:
{ "name":"team pink", "memberIds":[] }
Successful response:
Status: 201 CREATED
Content-Type: application/json
Body:
{ "id":4,"name":"team pink","memberIds":[] }
Retrieving a list of all UserGroups
A list of all userGroups available can be retrieved by sending a GET request
/api/userGroups
The response is of content-type JSON and will contain a list of userGroups.
If no usergroups are available, an empty list will be returned.
GET /api/userGroups
Successful response:
Status: 200 OK
Content-Type: application/json
Body:
[
{"id":1,"name":"team carmine","memberIds":[1,2,3]},
{"id":3,"name":"team puce","memberIds":[]}
]
Modifying a UserGroup
A previously created userGroup is modified by sending a PUT request
/api/userGroups/{id}
using content-type JSON, where {id} is the unique identifier of the userGroup.
The body must contain the following mandatory fields:
- id
- name
- memberIds
The ID in the request body MUST match the unique identifier in the request path.
Success is indicated by status code 204. No body is returned.
Failure due to user error is indicated by status code 400.
Request:
PUT /api/userGroups/1
Content-Type: application/json
Body:
{ "id": 17, "name":"newName", "memberIds":[1,2,3]}
Successful response:
Status: 204 NO_CONTENT
Deleting a UserGroup
A previously created userGroup is deleted by sending a DELETE request
/api/userGroups/{id}
where {id} is the unique identifier of the userGroup.
Success is indicated by status code 204. No body is returned.
Failure due to user error is indicated by status code 400.
Request:
DELETE /api/userGroups/2
Successful response:
Status: 204 NO_CONTENT
No Comments