API Guide - Finding Appointment Openings

For requests or help with our API
Locked
SLeon
Posts: 539
Joined: Mon Mar 01, 2021 10:00 am

API Guide - Finding Appointment Openings

Post by SLeon » Thu Aug 29, 2024 11:20 am

This guide describes how to find openings where providers and operatories are available for booking appointments. Most scheduling applications will need to create or follow a similar algorithm, as dental offices can have schedules set up in a variety of ways.

Note: We do not recommend the Appointments GET Slots endpoint for dental offices with multiple locations or multiple providers.

Open Dental's appointment search first collects all the schedules for the specified date range, and then removes times that are unavailable. To do this via the API:

Step 1
Run Schedules GET for the date(s) you want to have information on. This will likely be a single day or workweek.
You will get the times all the providers are scheduled to work and which operatories they are scheduled in.
You will also get the times of any blockouts that are scheduled during that time.

Example response:
Schedules_GET.gif
Schedules_GET.gif (9.26 KiB) Viewed 18502 times

Together this represents all possible schedulable times for the entire dental office.
Documentation: https://www.opendental.com/site/apischedules.html

Step 2
Run Appointments GET (multiple) for the same date range.
On each appointment, you can see which provider is unavailable in which operatory.
The time the provider is unavailable in that operatory is the appointment.AptDateTime and the duration is represented in appointment.Pattern.

Example response, with relevant fields highlighted:
Appointments_GET.gif
Appointments_GET.gif (15.17 KiB) Viewed 18502 times

Together this represents the times for the entire dental office that are not available for scheduling.
Documentation: https://www.opendental.com/site/apiappointments.html

Combine
To build your available schedule, you will simply take all possible schedulable times in #1 and remove all of the unavailable times from #2. Then you will have a comprehensive view for when appointments can be scheduled.

There are two ways to keep this list up-to-date:
  • Use the DateTStamp filter in Appointments GET (multiple) to see all the appointments that have been added/changed since the last time you checked. Adjust the information you gathered in #2 above with these results.
  • Use Subscriptions POST to subscribe to changes to the dental office's appointment table. At a polling interval you specify (e.g. 5 seconds), Open Dental will automatically query the appointment table for rows that have changed since the last interval (using DateTStamp). This list of appointments is then automatically sent to a webhook endpoint you specified in the Subscription. You would then use this data to adjust the information you gathered in #2 above.

Locked