Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (25 sloc) 1.86 KB

Pagination

To control the size of the response of a list request, items can be paginated.

A list request is a request that is meant to retrieve a large number of items such as all payments of a certain monetary account GET /v1/user/1/monetary-account/1/payment. You can choose the maximum amount of items to be included in the response by adding a count query parameter with the number of items you want per page to the URL.

Example: GET /v1/user/1/monetary-account/1/payment?count=25

When no count is given, the default count is set to 10. The maximum count you can set is 200.

With every listing, a Pagination object will be added to the response. It will contain the URLs you need to use to get the next or previous set of items. You can also use these URLs to navigate through the listed resources.

Here is what a Pagination object looks like:

{
    "Pagination": {
        "future_url": null,
        "newer_url": "/v1/user/1/monetary-account/1/payment?count=25&newer_id=249",
        "older_url": "/v1/user/1/monetary-account/1/payment?count=25&older_id=224"
    }
}

The newer_url value can be used to get the next page.

  • The newer_id is always the id of the last item in the current page.
  • If newer_url is null, there are no more items to be listed on the next page. The next page thus does not exist.

The older_url value can be used to get the previous page.

  • The older_id is always the id of the first item in the current page.
  • If older_url is null, there are no items on the previous page. The previous page thus does not exist.

The future_url can be used to refresh the list and check for new items that didn't exist when the listing was requested.

  • The newer_id will always be the id of the last item in the current page.
  • future_urlwill be null if newer_id is not also the id of the latest item.
You can’t perform that action at this time.