Pagination

API requests that return collections of records are always paginated. The default page size of 20 records can be adjusted by setting the ?per_page= parameter. The maximum number of records per page is 100.

Use the Link Header to browse through the pages of the result.

$ curl https://api.4me.com/v1/requests?page=4&per_page=25&search_after=eyJvZmZzZXQiOjUsImN1cnNvciI

Pagination information will be returned in the response header.

X-Pagination-Per-Page: 25
X-Pagination-Current-Page: 3
X-Pagination-Total-Pages: 10
X-Pagination-Total-Entries: 243

Use the the Link header to browse through the pages of the result:

Link: <https://api.4me.com/v1/requests?page=1&per_page=25>; rel="first",
      <https://api.4me.com/v1/requests?page=2&per_page=25&search_before=IicvNnc1NmIsUjOiQXZzZmZvJye>; rel="prev",
      <https://api.4me.com/v1/requests?page=4&per_page=25&search_after=eyJvZmZzZXQiOjUsImN1cnNvciIx>; rel="next"

The possible rel values are:

first
Shows the URL of the first page of results.
prev
Shows the URL of the immediate previous page of results.
next
Shows the URL of the immediate next page of results.

Deprecation warning: For a limited time, the API still supports paging by manually incrementing the page parameter, instead of using the URLs of Link Header. However, you must go through the pages in order. If you skip 1 or more pages, the API will return a 400 HTTP Status code.

As an example, suppose that you just requested curl https://api.4me.com/v1/requests?per_page=25&page=4. You are then allowed to request curl https://api.4me.com/v1/requests?per_page=25&page=5, but not curl https://api.4me.com/v1/requests?per_page=25&page=6

Throttling

In some cases, most notably the Audit Entries and Notes APIs, the maximum number of records that can be retrieved as a single collection of pages is limited to 100.000 records. When more than 100.000 records are found by an API request, the following is included in the HTTP Response Header:

X-Pagination-Throttled: true