This is documentation for the API endpoint for the webhooks the VoiceBot will call in order to retrieve appointment types, availability and perform booking, modification and cancellations of appointments.
The VoiceBot will make the following call sequence upon receiving and answering a call:
First, getEntityForSipId will be called with the sipId of the phone number the VoiceBot agent answers the call. This function as a kind of router in case there are multiple phone numbers calls are received on mapping to different business entities. The returned entityId will be used for all subsequent requests in the call session.
With the retrieved business entity, a second request getBusinessName is being made in order to retrieve a human/official name of the business for the greeter to the caller.
Typically a business is providing different appointment types. For instance, a physiotherapist might offer massages or medical gymnastics. The voicebot will query the available appointment types once it detected that the caller wants to arrange an appointment. The appointment types are queried using the getAppointmentTypes.
Next, the available agents who can fullfill the chosen appointment type will be queried such that the client/customer/patient's preference with whom he/she wants to have the appointment with can be satisfied. The voicebot will query the available agents via the getAgents webhook.
With each appointment type, one or more products can be associated/provided. For instance, a physiotherapist might offer a 30mins or a 45mins massage. The voicebot will query the available products once the caller chosen a specific appointment type using the getProducts webhook.
In rare cases, the voicebot will also query the list of appointment types including the available products using the getAppointmentTypesWithProducts webhook.
Once the client chose an appointment type and a product (Note that the question for which product the client/customer/patient may want will be skipped if only a single product is available for the chosen appointment type. The same applies for the appointment types.), the voice bot will query the available time slots for a specific day though the getSlots webhook.
After the client selected a timeslot, the voicebot will query what information it should retrieve from the caller to finalize the booking such as firstname and lastname, address, date of birth etc. The information that should be queried will be retrieved using the getRequiredInfo webhook.
Finally, after collecting all information from the client/customer/patient, the voicebot will call the bookAppointment webhook providing all collected information.
In case the client/customer/patient wants to modify or cancel an existing appointment, the voicebot will first query the user for essential information such as firstname and lastname. The collected information will be reported via the findExistingUser webhook which should return a list of matching clients/customers/patients. In case the list contains more than one client/customer/patient, the voicebot will ask the user about the next attribute which discriminates the set of returned client/customer/patient. For instance, if the list contains two clients with the exact same first and lastname but different date of birth, the voicebot will ask the caller for his date of birth in order to determine the exact and correct. client/customer/patient.
Once, the client/customer/patient has been correctly identified, the existing future appointments are retrieved using the findExistingBooking webhook. In case more than a single booking/appointment exits, the voicebot will ask the caller which one of the existing appointments the user would like to cancel or modify.
After the caller confirmed, that he/she would like to cancel a specific appointment, the cancelAppointment webhook will be triggered.
In case the user would like to modify a specific appointment, the voicebot will start negotiating a new timeslot with the user by calling the getSlots webhook.
After the caller confirmed the new time slot for the existing appointment, the modifyAppointment webhook will be triggered providing a reference to the old slot and the new slot.
Requests an entityId based on the provided telephony endpoint / the number that has been called.
action | string Value: "getEntityForSipId" Action/operation type of the webhook. |
sipId | string Unique id that for the telephony endpoint / the number that has been called. |
{- "action": "getEntityForSipId",
- "sipId": "phoneSipId12345678"
}
{- "entityId": "xyzBusinessEntityId"
}
Requests an entityId based on the provided telephony endpoint / the number that has been called. This maps a number that a call has been received for and the voice bot of the business entity that should respond to that particular called phone number.
action | string Value: "getBusinessName" Action/operation type of the webhook. |
entityId | string Unique id that represents the business entity. |
{- "action": "getBusinessName",
- "entityId": "xyzBusinessEntityId"
}
{- "name": "Physiotherapie Gleichgewicht"
}
Requests all available appointment types that can be booked by the customer for the given business entity.
action | string Value: "getAppointmentTypes" Action/operation type of the webhook. |
entityId | string Unique id that represents the business entity. |
{- "action": "getAppointmentTypes",
- "entityId": "xyzBusinessEntityId"
}
[- {
- "id": "abc1",
- "name": "Massage"
}, - {
- "id": "def2",
- "name": "Krankengymnastik"
}
]
Retrieves all available agents for the specified appointment type.
action | string Value: "getAgents" Action/operation type of the webhook. |
entityId | string Unique id that represents the business entity. |
appointmentTypeId | string Unique id of the appointment type to retrieve the available agents |
{- "action": "getAgents",
- "entityId": "xyzBusinessEntityId",
- "appointmentTypeId": "abcAppointmentTypeId"
}
[- {
- "id": "agId1",
- "gender": "male",
- "firstname": "Max",
- "lastname": "Mustermann"
}, - {
- "id": "agId2",
- "gender": "male",
- "firstname": "Hans",
- "lastname": "Meyer"
}
]
Retrieves all available products for the specified appointment type.
action | string Value: "getProducts" Action/operation type of the webhook. |
entityId | string Unique id that represents the business entity. |
appointmentTypeId | string Unique id of the appointment type to retrieve the available products |
{- "action": "getProducts",
- "entityId": "xyzBusinessEntityId",
- "appointmentTypeId": "abcAppointmentTypeId"
}
[- {
- "id": "prId1",
- "name": "30 min Massage",
- "duration": 30,
- "description": "A 45 mins relaxing massage",
- "price": 45
}, - {
- "id": "prId2",
- "name": "45 min Massage",
- "duration": 45,
- "description": "A 45 mins relaxing massage",
- "price": 60
}
]
Retrieves available slots for the specified appointment type and product.
action | string Value: "getSlots" Action/operation type of the webhook. |
appointmentTypeId | string Unique id of the appointment type to retrieve the available time slots for. |
agentId | string or null Unique id of the agent to retrieve the available time slots for if the client/customer/patient had a preference. |
productId | string Unique id of the product to retrieve the available time slots for. |
dateTime | string Starting date time timestamp (in ISO 8601 format) or time slot query. |
timezone | string Timezone to format the returned time slots. |
{- "action": "getSlots",
- "appointmentTypeId": "abcAppointmentTypeId",
- "agentId": "abcAgentId",
- "productId": "abcProductTypeId",
- "dateTime": "2024-09-16",
- "timezone": "Europe/Berlin"
}
[- {
- "avId": "abcAvId1",
- "slotStart": "2024-09-16T08:00:00.000+02:00",
- "slotEnd": "2024-09-16T08:30:00.000+02:00"
}, - {
- "avId": "abcAvId2",
- "slotStart": "2024-09-16T08:30:00.000+02:00",
- "slotEnd": "2024-09-16T09:00:00.000+02:00"
}, - {
- "avId": "abcAvId3",
- "slotStart": "2024-09-16T09:00:00.000+02:00",
- "slotEnd": "2024-09-16T09:30:00.000+02:00"
}
]
Retrieves what fields such as firstname, lastname etc. should be queried when booking the selected product. Each product might require different information in order to be booked. This webhook will request a list of required information to be queried from the user in order to fullflill the booking.
action | string Value: "getRequiredInfo" Action/operation type of the webhook. |
productId | string Unique id of the product to retrieve the required user information for. |
{- "action": "getRequiredInfo",
- "productId": "abcProductTypeId"
}
{- "bookerInfo": [
- "firstname",
- "lastname",
- "phone",
- "email"
], - "participantInfo": [
- "firstname",
- "lastname",
- "dob"
]
}
Submits the information to book the appointment. The submitted information contains the chosen appointment type and product, the selected timeslot as well as participant information.
action | string Value: "bookAppointment" Action/operation type of the webhook. |
appointmentTypeId | string Unique id of the appointment type chosen for the booking. |
productId | string Unique id of the chosen product for the booking. |
slotId | string Unique id of the chosen slot for the booking. |
start | string Starting date time timestamp (in ISO 8601 format) of the timeslot. |
object (User) The user record of the booking person. | |
object (User) The user record of the participant person. |
{- "action": "bookAppointment",
- "appointmentTypeId": "abcAppointmentTypeId",
- "productId": "abcProductTypeId",
- "slotId": "abcProductTypeId",
- "start": "2024-09-16T08:30:00.000+02:00",
- "booker": {
- "id": "abcUserId",
- "firstname": "Max",
- "lastlame": "Mustermann",
- "email": "max.mustermann@mailinator.com",
- "dob": "1985-07-25",
- "phone": "+49-341-1234567",
- "street": "Beispiel Str. 2",
- "zip": "01044",
- "city": "Musterstadt",
- "country": "Musterland"
}, - "participant": {
- "id": "abcUserId",
- "firstname": "Max",
- "lastlame": "Mustermann",
- "email": "max.mustermann@mailinator.com",
- "dob": "1985-07-25",
- "phone": "+49-341-1234567",
- "street": "Beispiel Str. 2",
- "zip": "01044",
- "city": "Musterstadt",
- "country": "Musterland"
}
}
Submits the information to modify a previously booked appointment. The submitted information contains the newly chosen time slot if the user/participant required to modify ist.
action | string Value: "modifyAppointment" Action/operation type of the webhook. |
bookingId | string Unique id of booking record. |
slotIdOld | string Unique id of the chosen slot that needs to be cancelled. |
slotIdNew | string Unique id of the newly chosen slot for the booking. |
start | string Starting date time timestamp (in ISO 8601 format) of the new timeslot. |
{- "action": "modifyAppointment",
- "bookingId": "abcBookingId",
- "slotIdOld": "abcSlotIdOld",
- "slotIdNew": "abcSlotIdNew",
- "start": "2024-09-16T08:30:00.000+02:00"
}
Submits the information to cancel a previously booked appointment. The submitted information contains the booking and slot that requires cancellation.
action | string Value: "cancelAppointment" Action/operation type of the webhook. |
bookingId | string Unique id of booking record. |
slotId | string Unique id of the chosen slot that needs to be cancelled. |
start | string Starting date time timestamp (in ISO 8601 format) of the timeslot to be cancelled. |
{- "action": "cancelAppointment",
- "bookingId": "abcBookingId",
- "slotId": "abcSlotId",
- "start": "2024-09-16T08:30:00.000+02:00"
}
Queries for existing users in the system. The submitted information contains partial information such as firstname, lastname to find existing users for previous bookings.
action | string Value: "findExistingUser" Action/operation type of the webhook. |
object (User) The provided user data to find existing bookings. |
{- "action": "findExistingUser",
- "participant": {
- "id": "abcUserId",
- "firstname": "Max",
- "lastlame": "Mustermann",
- "email": "max.mustermann@mailinator.com",
- "dob": "1985-07-25",
- "phone": "+49-341-1234567",
- "street": "Beispiel Str. 2",
- "zip": "01044",
- "city": "Musterstadt",
- "country": "Musterland"
}
}
[- {
- "id": "abcUserId",
- "firstname": "Max",
- "lastlame": "Mustermann",
- "email": "max.mustermann@mailinator.com",
- "dob": "1985-07-25",
- "phone": "+49-341-1234567",
- "street": "Beispiel Str. 2",
- "zip": "01044",
- "city": "Musterstadt",
- "country": "Musterland"
}
]
Submits the information contains the userId of the previously identified user. The submitted information contains the userId of users that have bookings with the system.
action | string Value: "findExistingBooking" Action/operation type of the webhook. |
id | string The userId of the identified user. |
{- "action": "findExistingBooking",
- "id": "abcUserId"
}
[- {
- "bookingId": "abcBookingId",
- "name": "Massage",
- "slotId": "abcSlotId",
- "start": "2024-09-16T08:30:00.000+02:00",
- "productId": "abcProductId"
}
]