Documentation
Difficulty level:
API - Event - GET event/search
GET event/search
Used for
searching through all events and returning events for the given criteria.
Authentication
No authentication required, public information.
Parameters
Parameter | Description | Required | Default | Example |
---|---|---|---|---|
lang | Language | No | dutch | english |
DateFrom | Start date of period to search for | No | Today | |
DateTill | End date of period to search for | No | Today + 7 days | |
params | A array of hard and soft criteria in JSON format Event custom fields, display name can be used when this is unique Object custom fields, display name can be used when this is unique |
No | <empty> | params=[{"event_custom01":"Utrecht","operator":"=","type":"OR"},{"province":"Groningen","operator":"=","type":"OR"}] |
page | The page to show | No | 1 | |
per_page | The number of records per page | No | 10 | Maximum of 100 events per page |
- Note that the params must be url-encoded. This means it will be seen like "params=[{%22event_cust".
- Params can contain multiple criteria. Per default type will be AND. Per default operator will be "=". These can be left out of the request if defaulted.
- Both display name as well as technical name can be used in params. If display name is used, the display name needs to be unique, else an error is thrown.
Response codes
- 200 OK
- 412 Precondition failed: Display name not unique
Example
Searching the events.
GET api/rest/event/search/?DateFrom=2012-08-01&DateTill=2012-08-11&page=1&per_page=5&lang=dutch
Response: { "page": 1, "pages": 24, "per_page": 5, "total": 117, "events": [ { "event_id": "2012-08-08_1", "object_desc": "Hiking", "event_desc": "Hiking in summer", "DateFrom": "2012-08-08 10:00:00", "DateTill": "2012-08-08 12:00:00", "location": "forest", "Booked": "6", "Free": "4" }, { "event_id": "2012-08-09_1", "object_desc": "Hiking", "event_desc": "Hiking in afternoon", "DateFrom": "2012-08-09 13:00:00", "DateTill": "2012-08-09 17:00:00", "Booked": "6", "Free": "4" } ] }