Swish Developer Docs
Go to websiteInstall now
  • Swish API
    • Overview
    • Authentication
    • Rate limits
    • Pagination
    • Errors
    • API Reference
      • Items
      • Lists
      • Profiles
  • Libraries
    • API Client
    • Browser
    • Node.js
    • React
Powered by GitBook
On this page
  1. Swish API

Pagination

Some endpoints return paginated results. The formatting of a paginated result is always:

{
  "pageInfo": {
    "next": "...",
    "previous": "..."
  },
  "data": []
}

The object pageInfo will be omitted if there are no next and previous pages.

The pageInfo.next or pageInfo.previous value can be added to the query parameters of the original query under the page key in order to get the next or previous page. The values can be omitted, which indicates that there is no next or previous page respectively.

Example

You make a GET request to a paginated endpoint /items, and receive the following response:

{
  "pageInfo": {
    "next": "next-page-cursor"
  },
  "data": []
}

In order to get the next page of results, you would take the cursor from pageInfo.next in the response body, and provide it as the value of the page key in a query to the same endpoint. The full path including query parameters of your request to get the next page of the listing is:

/items?page=next-page-cursor

PreviousRate limitsNextErrors

Last updated 3 months ago