Pagination

All top-level API resources have support for bulk fetches via "list" API methods. For instance, you can list properties, list units and list leases.

These list API methods share a common structure, taking at least these two query parameters: page_size (defaults to 50, max 1,000) and page_number (defaults to 1).

Examples

Here is an example on how to use pagination query parameters on the List all Properties endpoint to return properties in positions 51-100:

url --request GET \
2     --url https://app.doorloop.com/api/properties?page_number=2&page_size=50 \
3     --header 'Accept: application/json' \
4     --header 'Authorization: bearer your_api_token_goes_here'

And here is an example which shows how to return 100 results on the first page, omitting the page_number parameter which sets its default value of 1:

url --request GET \
2     --url https://app.doorloop.com/api/properties?page_size=100 \
3     --header 'Accept: application/json' \
4     --header 'Authorization: bearer your_api_token_goes_here'

All "list" API methods will return an object which contains two fields:

"total": Indicates the total number of records available based on the query to that endpoint.
"data": An array of objects contains the actual records returned for the requested page number and size.

{
  "total": 150,
  "data": [
    {
      ...
    },
    {
      ...
    },
    ..
    ..
    ..
  ]
}