Sendoso’s API supports pagination for most of the GET endpoints to allow you to retrieve a large number of resources in smaller chunks. This can be useful when retrieving lists of resources, such as sends or users, that exceed the maximum number of resources that can be returned in a single response.

Pagination can be achieved by using the page and page_size query parameters in your API requests.

page
integer
required

The page number of the results you want to retrieve. The first page is 1.

per_page
integer
required

The number of resources to be returned per page.

For example, to retrieve the second page of campaigns with a page size of 50, you would make the following GET request:

GET https://app.sendoso.com/campaigns?page=2&per_page=50

If your request returns a paginated result, the response will include the following fields at the root with the following pagination information:

current_page
integer
required

The total number of resources available.

per_page
integer
required

The number of resources per page.

total_{resource}
integer
required

The total number of resources available.

{
  "campaigns": [...],
  "current_page": 2,
  "per_page": 50,
  "total_campaigns": 234
}