Overview
Custom Pagination allows users to define their own pagination logic when an API does not follow standard pagination mechanisms.
This feature enables the use of custom Python scripts to control how the next set of records is fetched, ensuring reliable data retrieval from non-standard or proprietary APIs.
When to Use
Use Custom Pagination when the target API does not support common pagination formats such as page numbers, offsets, or cursors.
- APIs with token-based pagination
- APIs using encrypted or encoded continuation tokens
- Custom enterprise or legacy systems
- Endpoints with non-documented pagination logic
- APIs requiring transformation before the next request
How It Works
In Custom Pagination, users define pagination behavior using Python logic.
The script determines how the next request is constructed by analyzing the current response and extracting required values such as tokens, offsets, or identifiers.
This logic is executed for each request cycle until all records are retrieved or pagination conditions are met.
Custom Pagination Logic
A Python script can be written to handle special pagination scenarios.
The script may perform the following operations:
- Extract pagination tokens from responses
- Encode or decode continuation values
- Transform request parameters
- Update headers or query parameters
- Control request flow based on response content
Example Use Cases
Custom Pagination is commonly used in the following scenarios.
- Fetching records using session-based tokens
- Handling APIs that return next-page links in custom formats
- Processing encrypted pagination identifiers
- Managing conditional pagination logic
- Supporting APIs without documented pagination standards
How to Configure Custom Pagination
Follow these steps to configure Custom Pagination in eZintegrations.
- Open the Integration Bridge configuration.
- Select the required API source, operation, or target.
- Navigate to the Pagination settings.
- Choose the Custom Pagination option.
- Enter the required Python script.
- Save the configuration.
- Test the workflow to validate pagination behavior.
Benefits
Custom Pagination provides flexibility and control when working with non-standard APIs.
- Supports complex pagination models
- Improves data extraction reliability
- Enables integration with proprietary systems
- Reduces dependency on API limitations
- Enhances automation workflows
Notes
- Custom scripts must follow platform execution guidelines.
- Ensure pagination logic prevents infinite loops.
- Validate response data before processing tokens.
- Test pagination with sample datasets.
- Document custom logic for long-term maintenance.