VoiceBot Integration v1.0 (1.0.14)

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.

General Workflow

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.

Appointment Bookings

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.

Appointment Modifications & Cancellations

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.

Webhook

getEntityForSipId Webhook

Requests an entityId based on the provided telephony endpoint / the number that has been called.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "action": "getEntityForSipId",
  • "sipId": "phoneSipId12345678"
}

Response samples

Content type
application/json
{
  • "entityId": "xyzBusinessEntityId"
}

getBusinessName Webhook

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.

Request Body schema: application/json
action
string
Value: "getBusinessName"

Action/operation type of the webhook.

entityId
string

Unique id that represents the business entity.

Responses

Request samples

Content type
application/json
{
  • "action": "getBusinessName",
  • "entityId": "xyzBusinessEntityId"
}

Response samples

Content type
application/json
{
  • "name": "Physiotherapie Gleichgewicht"
}

getAppointmentTypes Webhook

Requests all available appointment types that can be booked by the customer for the given business entity.

Request Body schema: application/json
action
string
Value: "getAppointmentTypes"

Action/operation type of the webhook.

entityId
string

Unique id that represents the business entity.

Responses

Request samples

Content type
application/json
{
  • "action": "getAppointmentTypes",
  • "entityId": "xyzBusinessEntityId"
}

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

getAgents Webhook

Retrieves all available agents for the specified appointment type.

Request Body schema: application/json
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

Responses

Request samples

Content type
application/json
{
  • "action": "getAgents",
  • "entityId": "xyzBusinessEntityId",
  • "appointmentTypeId": "abcAppointmentTypeId"
}

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

getProducts Webhook

Retrieves all available products for the specified appointment type.

Request Body schema: application/json
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

Responses

Request samples

Content type
application/json
{
  • "action": "getProducts",
  • "entityId": "xyzBusinessEntityId",
  • "appointmentTypeId": "abcAppointmentTypeId"
}

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

getSlots Webhook

Retrieves available slots for the specified appointment type and product.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "action": "getSlots",
  • "appointmentTypeId": "abcAppointmentTypeId",
  • "agentId": "abcAgentId",
  • "productId": "abcProductTypeId",
  • "dateTime": "2024-09-16",
  • "timezone": "Europe/Berlin"
}

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

getRequiredInfo Webhook

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.

Request Body schema: application/json
action
string
Value: "getRequiredInfo"

Action/operation type of the webhook.

productId
string

Unique id of the product to retrieve the required user information for.

Responses

Request samples

Content type
application/json
{
  • "action": "getRequiredInfo",
  • "productId": "abcProductTypeId"
}

Response samples

Content type
application/json
{
  • "bookerInfo": [
    ],
  • "participantInfo": [
    ]
}

bookAppointment Webhook

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.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "action": "bookAppointment",
  • "appointmentTypeId": "abcAppointmentTypeId",
  • "productId": "abcProductTypeId",
  • "slotId": "abcProductTypeId",
  • "start": "2024-09-16T08:30:00.000+02:00",
  • "booker": {
    },
  • "participant": {
    }
}

modifyAppointment Webhook

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.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "action": "modifyAppointment",
  • "bookingId": "abcBookingId",
  • "slotIdOld": "abcSlotIdOld",
  • "slotIdNew": "abcSlotIdNew",
  • "start": "2024-09-16T08:30:00.000+02:00"
}

cancelAppointment Webhook

Submits the information to cancel a previously booked appointment. The submitted information contains the booking and slot that requires cancellation.

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "action": "cancelAppointment",
  • "bookingId": "abcBookingId",
  • "slotId": "abcSlotId",
  • "start": "2024-09-16T08:30:00.000+02:00"
}

findExistingUser Webhook

Queries for existing users in the system. The submitted information contains partial information such as firstname, lastname to find existing users for previous bookings.

Request Body schema: application/json
action
string
Value: "findExistingUser"

Action/operation type of the webhook.

object (User)

The provided user data to find existing bookings.

Responses

Request samples

Content type
application/json
{
  • "action": "findExistingUser",
  • "participant": {
    }
}

Response samples

Content type
application/json
[
  • {
    }
]

findExistingBooking Webhook

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.

Request Body schema: application/json
action
string
Value: "findExistingBooking"

Action/operation type of the webhook.

id
string

The userId of the identified user.

Responses

Request samples

Content type
application/json
{
  • "action": "findExistingBooking",
  • "id": "abcUserId"
}

Response samples

Content type
application/json
[
  • {
    }
]