Appearance
Pagination
All of the "list" endpoints for bulk fetching support pagination. The list API methods share a structure and accept at least the two parameters limit
and start
. Both limit
and start
are optional. Making a request without specifying limit
will use a default page size of 5. Making a request without specifying start
will return the first page of results.
The response of a list API method represents a single page, with the page length being set by the limit
parameter. By default, most endpoints will default to reverse chronological order (newest objects first). See each endpoint for more details on sort and order options.
The data
property will contain a list of summary objects. Each one of those objects will have some summary attributes that are unique to the object. Each object will also have a urls
property, which contains a details
key, which is the URL of the endpoint you must query in order to retrieve the full details of the object. The urls
property may contain other keys with links to query for other related objects as well.
Parameters
Name | Optional | Default | Description |
---|---|---|---|
limit | optional | 5 | The limit of the number of objects returned in a single response, between 1 and 100. |
start | optional | 0 | The index position of the first object in the response. This is used to fetch the next page of the list. |
List response format
Name | Type | Description |
---|---|---|
object | string | Value is 'list'. A string describing the object type returned |
next | string | The URL to request the next page of the list. If not set, this is the last page of the list. |
limit | number | The limit parameter used in the request |
start | number | The start parameter used in the request |
data | array | An array containing the response objects for the requested page of the list |
size | number | The number of elements inside of data |
Example response
json
{
"object": "list",
"next": "/v1/campaigns?limit=5&start=5",
"limit": 5,
"start": 0,
"data": [
{
"object": "campaign",
"id": "e76d4cb7-e1e7-4579-ab24-7967377bfdd7",
"name": "Weekly Newsletter",
"status": "active",
"emails_count": 6,
"urls": {
"details": "/v1/campaigns/e76d4cb7-e1e7-4579-ab24-7967377bfdd7",
"emails": "/v1/campaigns/e76d4cb7-e1e7-4579-ab24-7967377bfdd7/emails",
},
},
{...},
{...},
{...},
{...},
],
"size": 5,
}