Step 1: Understand the Response
The API response includes two keys:next_cursor: The cursor for the next page.previous_cursor: The cursor for the previous page.
Step 2: Use Cursors for Navigation
To navigate between pages, pass the appropriate cursor value in thecursor query parameter:
- Next Page: Use
next_cursorfrom the response. - Previous Page: Use
previous_cursorfrom the response.
If you include the
updatedSince filter in your first request, do not include the updatedSince query parameter in subsequent requests that use a cursor query parameter. Combining these parameters will cause the API to return a 422 error.Example Request
Step 3: Handle Edge Cases
- If
next_cursorisnull, you’ve reached the end of the dataset. - If
previous_cursorisnull, you’re at the beginning of the dataset.
By following these steps, you can seamlessly implement pagination in your application using the Leen API.
The
limit parameter is unchanged and can still be used with cursor pagination to control the page size.