Skip to content

Pagination

Ticket and document list endpoints return a nested Laravel paginator.

Conceptually:

{
  "data": {
    "data": [ ...items... ],
    "current_page": 1,
    "last_page": 4,
    "per_page": 50,
    "total": 173,
    "next_page_url": "..."
  }
}

The SDK returns OkatanaPage<T>.

var page = client.projects().listTickets(
    projectId,
    new ListTicketsOptions().perPage(200)
);

Use items(), total(), currentPage(), and the optional navigation URLs.

Automatic traversal

for (var ticket : client.projects().iterateTickets(
    projectId,
    new ListTicketsOptions().perPage(200))) {
    process(ticket);
}

The iterator follows next_page_url rather than calculating the next page number.

Credential safety

Before following an absolute paginator link, the SDK checks:

  • same scheme;
  • same host;
  • same effective port;
  • path remains below the configured API base.

A link that fails this check is rejected before a bearer credential is sent.

Mutating a filtered collection while paging

If your loop moves or deletes items from the same filtered collection you are paging, a page-2 link can become stale because page membership changes. The board-consolidation example avoids this by repeatedly reading the first filtered page until it is empty.