Skip to content

Pagination

All list endpoints contain paginated results by default

Fields

by default

Root

FieldDescriptionData Type
dataArray objectsArray
metaName of the clientMeta
linksUrls for navigateLinks

Meta

FieldDescriptionData Type
itemsPerPageitems per pageint
totalItemstotal itemsint
currentPagepage currentint
totalPagespage totalint
sortByDescription sortArray
FieldDescriptionData Type
currentcurren page urlurl
nextnext page urlurl
lastlast page urlurl
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

FieldDescriptionData Type
pageThe page number to retrieve. It indicates which set of records to fetch. Default is 1.Integer
limitThe number of records to retrieve per page. It limits the amount of data returned.Integer
sortByThe 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