User Roles
#
Welcome to the user roles module API specification- This section will define APIs for the user roles feature/module. It will include API documentation for all CRUD operations involving a user role.
A single user role object, has the following keys
Key | Description | Required | Type |
---|---|---|---|
id | Unique identifier(Autogenerated) | Autogenerated | Number |
uid | 13 varying characters used for CRUD operations | NO | String(UID) |
name | Defines the user roles' given name | YES | String |
created | user roles' date of creation | NO | Date |
lastupdated | user roles' date for when it was last updated | NO | Date |
#
Creating a user roleMethod: POST
#
Creating a standalone user roleEndpoint
Request Payload
Response
- These responses can vary depending on success and failure however, to here we will show the success reponse.
Response
- These responses can vary depending on success and failure however, to here we will show the success reponse.
#
Get user rolesMethod: GET
Endpoint
Response
#
Pagination and Page sizes- You can define pages you want and the data per page size you want by passing query params in get request i.e page=2&pageSize=400
- This will return data of page two with size of 400 records per page
- If page and page size are not defined, the default is 1 and 100 respectively
Method: GET
Endpoint
- You can also pass params to get all data without pagination by passing in
paging=false
Method: GET
Endpoint
#
Get One user role(By ID)Endpoint
Response
#
Get user roles(By Specifying fields)NOTE: On getting user roles, whether a single user role or the whole list, we can also specify the fields and relations we want
Endpoint
Response
#
Get user roles categories (By filtering fields)- We can filter user roles depending on certain fields, more like a search strategy, in the example below, we will find all user roles with user role ame equal to
user role Name
Endpoint
Response
NOTE: All filtering mechanisms, can be combined to produce a lobust search strategy
- Available search and filter Operators
Operator | Types | Value Required | Description |
---|---|---|---|
eq | string | boolean | integer | float | enum | collection (checks for size) | date | true | Equality |
like | string | true | Case sensitive string, match anywhere |
ilike | string | true | Case insensitive string, match anywhere |
in | string | boolean | integer | float | date | true | Find objects matching 1 or more values |
#
Update a user roleMethod: PUT
Endpoint
Request Payload
Response
#
Delete a user roleMethod: DELETE
Endpoint
Response