Page number parameter pagination method
Overview
In this method, the required page number is included as a parameter in the API request, and is incremented in each request to get the next page.
Page number parameter options
Option | Summary |
---|---|
Limit parameter name | Enter the name of the query parameter to be passed into the URL to tell the receiving system the maximum number of items that the API should return in a single page of a paginated response. A commonly used name is: |
Limit parameter path | Enter the dot notation path to the limit parameter name. |
Page parameter name | Enter the name of the query parameter to be passed into the URL to tell the receiving system the required page number. A commonly used name is: |
Limit | Enter the number of items to be returned per page. For example: |
Path to the data in the response | If required, you can add a dot notation path to an element in the payload that you would expect to contain data if the data pull has not completed. For example, if you are pulling orders, you might expect to see data in an |
Example
Suppose we set the following options:
Option | Value |
---|---|
Limit parameter name |
|
Page parameter name |
|
Limit |
|
Path to the data in the response |
|
...and we send a request to get the first page of data:
The response will include the first page of data (sometimes with metadata regarding pagination). For example:
Our request for the next page of results would be:
When does pagination stop?
Pagination continues until the last page, when there is no more data to return.
Special notes
The page number parameter pagination method is implemented using a Patchworks pagination variable which contains the next page number:
This note is for reference only - there should never be a need to access/change this variable.
Last updated