Skip to content

Pagination

All resources coming in bulk are paginated when using Sender API.

Paginated response contains an object with 4 attributes: data, links, meta and has_more_resources.

Under data attribute you will find an array of requested resource objects.

Under links attribute you will find an object of links for other requests.

An example of links would look like this:

{
"first": "https://app.sender.net/client-api/api/campaigns?page=1",
"last": "https://app.sender.net/client-api/api/campaigns?page=257",
"prev": null,
"next": "https://app.sender.net/client-api/api/campaigns?page=2"
}

Under meta attribute you will find more information on available pages.

Example meta attribute:

{
"current_page": 1,
"from": 1,
"last_page": 257,
"path": "https://app.sender.net/client-api/api/campaigns",
"per_page": 5,
"to": 5,
"total": 1282
}
ParamValue
current_pageRequested page
fromFrom which item does the page start
toAt which item does the page end
last_pageLast page
pathRequest path
per_pageItems shown per page
totalTotal amount of items

Tells you if next page exists.

You can give your own pagination parameters. Since all listed requests are using GET HTTP method, we only accept route parameters.

Which page would you like to see?

How many items per page would you like in your response?

Which order should your data be displayed? Accepted values should be the key values from the resource data.

When using the pagination parameter ?order you are allowed to specify in which direction should the data be displayed. Accepted values are asc or desc, which stands for ascending or descending. The default value is desc.

You can turn:

https://api.sender.net/v2/campaigns/

Into:

https://api.sender.net/v2/campaigns?page=5&limit=20&order=modified&direction=desc

To see campaigns from 81st to 100th, ordered by their last time modified with direction descending.