Appointment Booking
This endpoint is where you will POST the actual appointment information to the server to create an appointment and either create a new prospect or modify an existing one. The payload is separated into two parts: appointment data and prospect data (client). Please note that while many of these fields are optional, prospect data is much more useful the more you collect. Consider performing client-side validation and requiring at minimum the people fields (first name, last name, email, phone). In addition, the employee group decides which appointment tour types are enabled and which ones are not and what platform of choices are available. See employee group documentation for more information.
/api/v2/appointments/group/:group_id/bookRequest
Response
{ "data":{ "appointment":{ "id": 952, "confirmation_enabled":true, "start":"2019-06-21T09:00:00+00:00", "location":"", "expiration_date":"2019-06-17T12:53:05.799365" } }}Timeslot No Longer Available (400)
If an appointment time is no longer available, a 400 error response will be returned.
{ "errors":{ "appointment":{ "start": ["No Employees free at Scheduled Appointment time"] } }}Missing Required Fields (400)
If any required fields are missing in the request, a 400 error response will be returned.
{ "errors": { "appointment": { "start": ["Missing data for required field."] } }}Invalid Data Types (400)
If invalid data types are passed in the request (e.g., is_video_tour set to 'no' instead of boolean, or tour_type set to 'invalid type'), a 400 error response will be returned.
{ "errors": { "appointment": { "tour_type": ["Not a valid choice."], "is_video_tour": ["Not a valid boolean."] } }}Invalid Prospect Field Values (400)
If any of the prospect fields fail validation (e.g., pets or laundry passed as strings instead of integers), a 400 error response will be returned.
{ "errors":{ "client":{ "pets": ["'dogs' is not a number"], "laundry": ["'in unit' is not a number"] } }}Missing Phone or Email for Person (400)
If a person associated with the appointment does not have a phone number or email, a 400 error response will be returned. Each person must have at least one contact method.
{"errors": { "client": { "people": { "1": { "_schema": [ "Person requires either an email or a phone number." ] } } }}}Invalid Person Data Type (400)
If the data type provided for a person is invalid (e.g., email passed as a number), a 400 error response will be returned.
{ "errors": { "client": { "people": { "0": { "email": ["Not a valid email address."] } } } }}Example Appointment Booking Flow

Screen 1: User selects a preferred tour type, available date, and time
In order for the user to select a preferred tour type, you'll first need to retrieve the available tour types. Keep in mind there are a few conditions that determine when what tour type is available. See our end-point for available tour types for more info.
/api/v2/group/123- Available tour types/api/v2/appointments/group/123/available-times/?from=2019-06-18- Available Appointment Times

Screen 2: Appointment Form
After user chooses a specific timeslot, the form is assembled using the configuration.

Screen 3 Success: Optional Confirmation Screen
User fills out the form and submits.
/api/v2/appointments/group/123/book/- Appointment Booking
After booking is confirmed, a 200 response is returned. Since this group in particular has appointment confirmations turned on, show the confirmation screen.

Screen 3 Error: Timeslot Not Available
It is possible that in the time between when the user selects an available time and they complete the booking form, the time they selected has gotten booked. Please account for this error, and give them the ability to select a new time.
/api/v2/appointments/group/123/book/- Appointment Booking
