REST API

Filtering & sorting

Filter and sort GET collection endpoints with the filter and sort request parameters.

Filtering

Filtering responses

curl -X GET \
  https://app.guestmanager.com/api/public/v2/events \
  -H 'Authorization: Token abcdefg' \
  -H 'Content-Type: application/json' \
  -d '{ "filter": { "ids": "1,2,3" } }'

For GET requests to a collection, e.g. /events, you can filter data using the filter request parameter. More details on which fields can be filtered on are described in the relevant endpoint.

Parameter Format Example
filter[ids] Comma separated string or JSON array. "1,2,3" or {"ids": [1,2,3]}
filter[created_at][from] date or datetime 2018-05-25
filter[created_at][to] date or datetime 2018-05-25

Sorting

Sorting responses

curl -X GET \
  https://app.guestmanager.com/api/public/v2/events \
  -H 'Authorization: Token abcdefg' \
  -H 'Content-Type: application/json' \
  -d '{ "sort": { "starts_at": "asc" } }'

For GET requests to a collection, e.g. /events, you can sort responses using the sort request parameter. More details on which fields can be sorted on are described in the relevant endpoint.

Parameter Value
sort[{field}] asc or desc

Where you replace {field} with the field to sort on, and specify the value as asc or desc. You may sort on multiple fields.

On this page