-
Notifications
You must be signed in to change notification settings - Fork 7
Users
Harmun edited this page May 14, 2019
·
2 revisions
Endpoints for user data
| Method | Path | Token Type | Description | Expected Body Input | Expected Output |
|---|---|---|---|---|---|
| post | /users | None | Create new user with User privileges | { userName, pssword } | { id, userName, dateCreated } |
| get | /users/:id | User | Return a user specified by id | None | { id, userName, dateCreated } |
| put | /users/:id | User | Update a user specified by id. User must the user to whom the token was issued | At least one or any combination of { userName, pssword } | { id, userName, dateCreated } |
| delete | /users/:id | User | Soft delete a user specified by id | None | { id, userName, role, dateCreated, deletedAt } |
To undelete a user with .put(/users/:id), deletedAt must be specified as false in the body input.
The resource referenced by the route must be associated with the user to whom the User token was issued.
| Method | Path | Token Type | Description | Expected Body Input | Expected Output |
|---|---|---|---|---|---|
| post | /admin | Admin | Create new user with Admin privileges | { userName, pssword } | { id, userName, role, dateCreated, deletedAt } |
| get | /users | Admin | Return all users as an array of objects | None | [ { id, userName, dateCreated, deletedAt, role, pssword }, ... ] |
| get | /users/:id | Admin/User | Return a user specified by id | None | { id, userName, dateCreated } |
| put | /users/:id | Admin | Update a user specified by id | At least one or any combination of { userName, deletedAt, role, pssword } | { id, userName, role, dateCreated, deletedAt } |
| delete | /users/:id | Admin/User | Soft delete a user specified by id | None | { id, userName, role, dateCreated, deletedAt } |