Appearance
Pagination
All list endpoints contain paginated results by default
Fields
by default
Root
| Field | Description | Data Type |
|---|---|---|
| data | Array objects | Array |
| meta | Name of the client | Meta |
| links | Urls for navigate | Links |
Meta
| Field | Description | Data Type |
|---|---|---|
| itemsPerPage | items per page | int |
| totalItems | total items | int |
| currentPage | page current | int |
| totalPages | page total | int |
| sortBy | Description sort | Array |
Links
| Field | Description | Data Type |
|---|---|---|
| current | curren page url | url |
| next | next page url | url |
| last | last page url | url |
json
{
"data": [
{
"id": 7,
"name": "OTROS",
"domainId": "AGG",
"createdAt": "2024-12-13T18:52:28.220Z",
"updatedAt": "2024-12-13T18:52:28.220Z",
"deletedAt": null
},
{
"id": 6,
"name": "MAIZ",
"domainId": "AGG",
"createdAt": "2024-12-13T18:52:28.171Z",
"updatedAt": "2024-12-13T18:52:28.171Z",
"deletedAt": null
}
],
"meta": {
"itemsPerPage": 2,
"totalItems": 7,
"currentPage": 1,
"totalPages": 4,
"sortBy": [
[
"createdAt",
"DESC"
]
]
},
"links": {
"current": "https://api-dev.aggraria.digital/v1.0/crops?page=1&limit=2&sortBy=createdAt:DESC",
"next": "https://api-dev.aggraria.digital/v1.0/crops?page=2&limit=2&sortBy=createdAt:DESC",
"last": "https://api-dev.aggraria.digital/v1.0/crops?page=4&limit=2&sortBy=createdAt:DESC"
}
}Usage
| Field | Description | Data Type |
|---|---|---|
| page | The page number to retrieve. It indicates which set of records to fetch. Default is 1. | Integer |
| limit | The number of records to retrieve per page. It limits the amount of data returned. | Integer |
| sortBy | The field by which to sort the records. It allows ordering the data based on specific criteria. | String |
Example Usage
Example Request
http
GET /crops?page=2&limit=10&sortBy=date