Some API endpoints may return a large number of records in response to a query. To make handling large payloads scalable, Marq's API uses pagination to limit the number of records returned in a response.
Every paginated endpoint takes two optional query parameters: pageSize
and pageToken
.
The pageSize
parameter is used to indicate the maximum number of records returned per page. By default, each page will contain a maximum of 200 records. If a pageSize greater than 200 is requested, only 200 will be returned. Any endpoints that override this default will document it explicitly.
The pageToken is provided by the API response and acts as a pointer to the next set of records.
Responses by paginated endpoints contain a URI in the Link
header called next
. This URI is provided to the client to facilitate getting the next paged response and will have the same pageSize
as the previous request. Page tokens are included in the next
URI and should be considered opaque tokens.
Examples
curl 'https://api.marq.com/v1/account/123456789/projects?pageSize=100&pageToken=eyJvIjoiMSIsImUiOj' \
--request 'GET' \
--header 'Authorization: Bearer <OAuth 2.0 Access Token>' \
Link: <https://api.marq.com/v1/account/123456789/projects?pageSize=100&pageToken=eyJvIjoiMSIsImUiOjE2Mjg2OTc3OTF9>; rel="next"