Pagination
All resources coming in bulk are paginated when using Sender API.
Attributes
Section titled “Attributes”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}| Param | Value |
|---|---|
current_page | Requested page |
from | From which item does the page start |
to | At which item does the page end |
last_page | Last page |
path | Request path |
per_page | Items shown per page |
total | Total amount of items |
has_more_resources
Section titled “has_more_resources”Tells you if next page exists.
Parameters
Section titled “Parameters”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?
?limit
Section titled “?limit”How many items per page would you like in your response?
?order
Section titled “?order”Which order should your data be displayed? Accepted values should be the key values from the resource data.
?direction
Section titled “?direction”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.
Example
Section titled “Example”You can turn:
https://api.sender.net/v2/campaigns/Into:
https://api.sender.net/v2/campaigns?page=5&limit=20&order=modified&direction=descTo see campaigns from 81st to 100th, ordered by their last time modified with direction descending.