Type Endpoints
The Type entity is referenced from the Item entity and references file types (image, pdf, etc).
Common Type Characteristics
-
Unique Identification: Each type has a unique identifier
idthat distinguishes them from other typies in the system. -
Type Data: For each type there is a description and a variable that determines whether it is active or inactive. The description indicates what type it is.
Endpoints
GET/Type/getType
Retrieve a paginated list with existing types in the database.
Description
Allows you to obtain a list of file types organized according to pagination parameters such as page number (page) and items per page (pageSize).
Parameters
| Name | Description | Type | Default Value |
|---|---|---|---|
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responses
JSON
{
"data": [
{
"id": "string",
"description": "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>
<description>string</description>
<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 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 indicates that the entity 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"} |