Empty result set or 400 error during offset pagination on large boards
0 reputation · 03 Mar 2024, 05:08 UTC
Trello REST API Pagination
When retrieving cards from a board using the /1/boards/{id}/cards endpoint, the API supports both offset-based pagination via the page parameter and cursor-based pagination using before and after.
A known constraint exists where offset pagination is limited to the first 1000 items. For boards containing datasets exceeding this threshold, requests where the product of page and limit exceeds 1000 may result in an error or an empty array, despite the existence of more records.
While cursor pagination allows for full traversal, the API does not provide a total count of matching resources in the response headers or body, making it difficult to calculate the total number of requests required for a complete sync.
- How can a client determine the total size of a dataset without iterating through every page?
- What is the recommended strategy to ensure no cards are missed or duplicated when concurrent modifications occur during a cursor-based traversal?