Role Endpoints
In the context of our API, a role represents a entity. This role indicates the function that each business partner has. It can be Client, Administrator, Representative (Agent), API User and some more.
Common Role Characteristics
-
Unique Identification: Each role has a unique identifier
idthat distinguishes them from other roles in the system. -
Rol Data: Typically, a role has associated information, in this case a name.
-
Status and Activity: There may be statuses that indicate whether the role is active, inactive, or temporarily suspended, depending on the platform's business rules and policies.
Endpoints
GET/Role/getRole
Retrieve Roles
Description
The GET method retrieves a paginated list of roles from the system. It allows to fetch roles data based on pagination parameters such as page number (page) and items per page (pageSize). The response includes detailed information about each rol, including their ID, full name and whether it is active or not.
Parameters
| Name | Description | Type | Default Value |
|---|---|---|---|
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responses
JSON
{
"data": [
{
"id": "string",
"name": "string",
"active": true
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<name>string</name>
<active>true</active>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
Possible Response Errors
| Error | Response Status | Response Body |
|---|---|---|
| This error occurs when a connection to the database cannot be established. It is an internal server problem. | 500 | {"code": 500,"error": "Database connection failed."} |
| This error occurs when you cannot insert or update items into the database. | 500 | {"code": 500,"error": "Invalid connection name, you cannot insert in default"} |
| This error indicates that the server rejects the request. | 400 | {"code": 400,"error": "Bad Request"} |
| This error occurs when you are not authorized. | 401 | {"code": 401,"error": "Unauthorized."} |
| This error occurs when the Rol could not be found. | 404 | {"code": 404,"error": "No entity found."} |
| This error occurs when you try to send too many requests in a short period of time. | 429 | {"code": 429,"error": "Too Many Requests"} |