Documentation
Difficulty level:
API - Event - POST event/subscribe
POST event/subscribe
Used for
Adding a booking for a specific event. The same can be achieved by the API for adding a booking. However, for events this method is easier.
Authentication
Anonymous access is allowed. If anonymous access, then update on customer id is not allowed.
If user is logged in, it depends on the rights. Making a booking:
- entity_booking_create_own - means user is allowed to create booking for customer which belongs to current logged in user
- entity_booking_create_owngroup - means user is allowed to create booking for customer which belongs to current logged in usergroup
- entity_booking_create_other - means user is allowed to create booking for customers in other groups
- entity_booking_create_all - means user is allowed to create booking for all customers
- Updating a customer needs - entity_customer_update
- Creating a customer needs - entity_customer_create
- Updating a customer other than the logged in user - means the user needs to have the right: entity_customer_update_other
Parameters
Parameter | Description | Required | Example |
---|---|---|---|
event_id | Event ID of the booking | Yes | 2012-08-08_1 |
customer | Customer object can be supplied If customer_id is supplied, the booking will be attached to that existing customer |
No | |
options | An array of options, each in combination of the option_name and the required number | No | |
participants | An array of participants, each in combination of the participant_name and the required number | No |
Example
Adding a booking for 4 people (2 adults and 2 children). Include a new customer and include an option.
POST api/rest/event/subscribe
Request: { "event_id": "2012-08-08_1", "number": "4", "customer": { "lastname": "Demo" }, "participants": { "0": { "Volwassenen": "2" }, "1": { "Kinderen": "2" } }, "options": { "0": { "taart": "1" } } } Response: { "status": true, "booking_id": 40690, "messages": [ "Booking made" ] }