Pagination scripts
Introduction
If a standard pagination type can't meet your pagination requirements, you can create a custom script and apply this as the pagination method for endpoints.
Elements of a pagination script
Pagination scripts typically include:
Inputs
Expected inputs must be inside the payload
key of the data
array. These are summarised below:
Request
An array/object representing the request parts for the current page:
body
A string version of the body.
headers
An array/object containing a key/value map of request headers.
method
The HTTP method.
url
The entire URL used in the request.
Response
An array/object containing the response parts returned from the request:
headers
An array/object containing a key/value map or response headers.
status_code
The HTTP response code.
Payload
The content saved as the payload. For example:
Outputs
If has_next_page
is true, a JSON-encoded array/object should be returned (within the payload
field) with the following:
has_next_page
Whether or not there is another page to be fetched.
url
The URL to use for the next page request.
headers
The headers to use for the next page request.
method
The HTTP method to use for the next page request.
body
The body content to use in the next request.
Pagination script example
The sample script below demonstrates link header
functionality.
Last updated