Skip to content

Pagination and filtering

Every list endpoint in the public API uses the same pagination envelope and the same query-parameter conventions. Filters are deliberately limited in v1 — only what the actual integrations need.

All list endpoints return a wrapped object — never a bare JSON array — with four top-level keys:

{
"count": 1234,
"next": "https://api.campone.ch/api/v1/public/bookings/?page=2",
"previous": null,
"results": [
{ "...": "..." },
{ "...": "..." }
]
}
FieldTypeMeaning
countintegerTotal number of records that match the query, across all pages
nextstring | nullAbsolute URL of the next page, or null if you are on the last page
previousstring | nullAbsolute URL of the previous page, or null if you are on the first page
resultsarrayThe records on the current page, serialized per-endpoint

The most reliable way to walk a result set is to follow the next link until it is null. Don’t reconstruct the URL yourself — the API may add or rename query parameters in a future minor version, and next already carries the correct ones.

Two pagination parameters work on every list endpoint:

ParameterDefaultMaxNotes
page11-indexed. Requesting a page past the end returns 404.
page_size50200Server clamps to the max — sending page_size=1000 will give you 200 records, not an error.

Example:

GET /api/v1/public/sites/?page=2&page_size=100

Filters in v1 are listed below. Anything not listed is not a supported parameter — sending it is silently ignored, not an error, but you cannot rely on that behaviour going forward.

ParameterTypeBehavior
statusstringExact match on the booking status code (e.g. confirmed, pending, cancelled).
check_in_fromdate (YYYY-MM-DD)Returns bookings with check_in_date >= the value.
check_in_todate (YYYY-MM-DD)Returns bookings with check_in_date <= the value.

Combine check_in_from and check_in_to to get an arrival window, e.g. all bookings checking in during July 2026:

GET /api/v1/public/bookings/?check_in_from=2026-07-01&check_in_to=2026-07-31

No filters in v1. Pull the full list and filter client-side, or page through it.

Customers — GET /api/v1/public/customers/

Section titled “Customers — GET /api/v1/public/customers/”

No filters in v1.

No filters in v1.

Sorting is not configurable in v1. Each endpoint has a fixed default order, chosen for the most common access pattern:

EndpointDefault sort
GET /api/v1/public/bookings/created_at descending — newest bookings first
GET /api/v1/public/sites/site_number ascending — natural campsite layout order
GET /api/v1/public/customers/date_joined descending — most recently registered first
GET /api/v1/public/invoices/created_at descending — most recently issued first

If you need a different order, sort client-side after fetching, or filter to narrow the result set first.