Next page token pagination method
Overview
This method is a slight variation on the next page URL approach. Instead of receiving a full URL in the response, it contains a 'token' (usually a random string/hash). The receiving system uses this token to keep track of the position of the last record in the current page of data.
Next page token options
Example
Suppose we set the following options:
...and we send a request to get the first page of data:
The response will include the first page of data, together with a next page token that should be used to get the next page of results. For example:
Notice the links.next
section at the end of this response, which includes our next page URL. So, our request for the next page of results would be:
When does pagination stop?
Pagination continues until the token is no longer included in the payload.
Special notes
The next page token pagination method is implemented using a Patchworks pagination variable which contains a token for the next page:
This note is for reference only - there should never be a need to access/change this variable.
Last updated