Pagination

About

Pagination is a way to obtain more data from endpoints. When an endpoint needs to return a large amount of data, it works more efficiently by dividing it into pages.

The Picus Rest API paginates by using offset and size, close to working logic in databases.

Pagination Method

Offset indicates what you want to return after an element and the size parameter specifies the number of elements should be on the page to return.

{
  offset: 0,
  size: 20
}

There are limitations about the offset and size parameters.
Offset parameter should be bigger than -1 and the size parameter should be bigger than 1.
Additionally, each endpoint that works with pagination has a maximum size.
You can check endpoint API Reference tab for learning maximum size.

📘

Maximum Size

Maximum size is different on each endpoint, as each endpoint returns different type of data.
Maximum size is decided base on the performance criteria.

Example

You can find examples about how to get pages with using offset and size.

//get first page with 20 element
{
  offset: 0,
  size: 20
}
//get second page with 20 element
{
  offset: 20,
  size: 20
}

📘

Picus Rest API Endpoint's Pagination

Not all endpoints need to work with pagination; only the endpoints which contain many elements work with pagination.
Such as Simulation List, Simulation Results - Threats - Objectives - Actions etc.