Request & response format
Request
Here's a revised version:
We recommend adding an Accept
header to your requests with the value application/json
since this is the only format we currently support.
Additionally, for each POST and PATCH request, we advise setting the Content-Type
header to application/json
as we expect data in JSON format from your applications.
Accept: application/json
Content-Type: application/json
Response
When querying our API, you'll receive a response structured for clarity and consistency. Here's an outline of the standard response format.
Response Format:
{
"data": [],
"pagination": {
"total": 30,
"count": 10,
"per_page": 10,
"current_page": 1,
"total_pages": 3,
"links": {
"next": "/endpoint?page=2",
"prev": null
}
}
}
Field Descriptions:
data
:
Depending on the endpoint you're accessing, this field will either be:
- An array of a multiple resources (a list).
- An object if the requested endpoint returns a single resource.
Some resources include internal fields. These fields are labeled as internal in the documentation. It's advised to refrain from using these fields since they might be altered or removed without notice.
pagination
:
An object providing pagination-related details.
total
: The overall count of items available.count
: The number of items presented in the current response.per_page
: The maximum quantity of items displayed per page.current_page
: Indicates the current page number.total_pages
: Shows the total number of pages available based on theper_page
count.links
: Contains navigation links pertinent to pagination.next
: Provides the URL to the succeeding page of results. This field will be alwaysnull
on the last page.prev
: Directs you to the previous page of results. This field will be alwaysnull
on the first page.