Continuation

Many REST services limit the number of items that can be retrieved from the service in a single call. To retrieve all items associated with a query, additional calls must be made to the service using a URL or additional data passed to the caller. The caller then makes repeated calls to the service using these continuation parameters to retrieve all records.

Jigx REST functions can be configured to automatically repeat calls to continuation functions by specifying a continuation block in the function YAML.

Configuration options

Options
Description

when

This condition determines when pagination continuation should occur. The continuation will execute only when the value exists in the API response.

url

This specifies the complete URL for the next page of results. Certain APIs, such as Microsoft Graph, provide the full continuation URL in the @odata.nextLink response field, which includes the base endpoint plus any necessary query parameters (like skip tokens or cursors) to retrieve the subsequent batch of data. This eliminates the need to manually construct pagination URLs. Other APIs require the full url to be specified.

parameters

These are the parameters required for continuation requests. Unlike the initial request, which included the optional $top query parameter, continuation requests only need the authentication token.

Example and code snippets

Microsoft Graph API uses continuation URLs to request the next page of items from their services. If there are more items in the response than can be handled in a single call, or the caller has limited the number of items per page, the service will return the @odata.nextLink parameter specifying the URL to call to fetch the next page of results.

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('bb13f9b6-d289-485f-9ae6-76be00f5bab3')/drive/root/children",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/me/drive/root/children?$top=2&$skiptoken=UGFnZWQ9VFJVRSZwX1NvcnRCZWhhdmlvcj0xJnBfRmlsZUxlYWZSZWY9TWljcm9zb2Z0K1RlYW1zK0NoYXQrRmlsZXMmc",
    "value": [
        {
	   ...
	}
    ]
}

All data has been returned when the @odata.nextLink parameter is no longer present in the results. Note, in this case, that the nextUrl expression is used to both check for continuation data as well as the URL to fetch the next page of data.

Continuation using URL

This code defines a REST API configuration for fetching tasks from ClickUp with automatic pagination handling. The when property checks if the current response contains exactly 100 tasks (ClickUp's page limit). If true, it assumes there are more pages to fetch. Then the same URL and parameters as the original request is used, and the page number is incremented.

  • First call: Fetches page 0 with up to 100 tasks

  • If 100 tasks returned: Automatically makes another call for page 1

  • Continues: Until a response has fewer than 100 tasks (indicating the last page)

  • Result: All pages are automatically fetched and combined into a single dataset

Last updated

Was this helpful?