Skip to content

Pagination ​

The list endpoints use three different formats.

No Pagination ​

List Ongoing Testimonies returns a plain data array with every matching testimony.

Page Pagination ​

List Testimonies History returns 20 items per page with Laravel's length-aware envelope. Select a page with the page query parameter (starting at 1); meta.last_page and meta.total tell how many pages and items exist.

json
{
  "data": [
    {
      "id": "01J5X3Y8ZK2Q4R6T8V0W2X4Y6Z"
    }
  ],
  "links": {
    "first": "https://api.brunago.sk/api/v1/me/testimonies/history?page=1",
    "last": "https://api.brunago.sk/api/v1/me/testimonies/history?page=3",
    "prev": null,
    "next": "https://api.brunago.sk/api/v1/me/testimonies/history?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 3,
    "links": [
      {
        "url": null,
        "label": "« Predchádzajúca",
        "active": false
      },
      {
        "url": "https://api.brunago.sk/api/v1/me/testimonies/history?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": "https://api.brunago.sk/api/v1/me/testimonies/history?page=2",
        "label": "2",
        "active": false
      },
      {
        "url": "https://api.brunago.sk/api/v1/me/testimonies/history?page=3",
        "label": "3",
        "active": false
      },
      {
        "url": "https://api.brunago.sk/api/v1/me/testimonies/history?page=2",
        "label": "Nasledujúca »",
        "active": false
      }
    ],
    "path": "https://api.brunago.sk/api/v1/me/testimonies/history",
    "per_page": 20,
    "to": 20,
    "total": 45
  }
}

Following the links

The URLs in links and meta.links repeat the search and sort parameters of your request (e.g. …/history?search=Nitra&sort=-createdAt&page=2), so they can be followed as they are.

Cursor Pagination ​

List Offerable Testimonies and List Own Offers return 50 items per page with Laravel's cursor-pagination envelope. While meta.next_cursor is not null, pass it as the cursor query parameter (or follow links.next) to fetch the next page. Offerable testimonies are ordered by creation time, oldest first; own offers newest first, and their links repeat the status filter of the request. There is no total count and no page number; links.first and links.last are always null.

json
{
  "data": [
    {
      "id": "01J5X3Y8ZK2Q4R6T8V0W2X4Y6Z"
    },
    {
      "id": "01J5X4A2B3C4D5E6F7G8H9J0K1"
    }
  ],
  "links": {
    "first": null,
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "path": "https://api.brunago.sk/api/v1/me/testimonies/offerable",
    "per_page": 50,
    "next_cursor": null,
    "prev_cursor": null
  }
}