How to: Post to public webhook?

For requests or help with our API
Post Reply
rinse-dental
Posts: 10
Joined: Wed Apr 06, 2022 12:04 pm

How to: Post to public webhook?

Post by rinse-dental » Sat May 14, 2022 10:00 am

Use Case: Send custom email/SMS to patient post visit (thank you, survey, etc.). I use Twilio for customer communication and have created a webhook that listens for an event. Is it possible for Open Dental to post to that webhook when appointment status changes to complete?

It seems API Events and API Subscriptions are designed to solve for this case but I can't seem to get it working. I've tested using https://webhook.site/ and it doesn't appear Open Dental's events are working... or, I'm doing something wrong. :D

SLeon
Posts: 146
Joined: Mon Mar 01, 2021 11:00 am

Re: How to: Post to public webhook?

Post by SLeon » Mon May 16, 2022 12:16 pm

API Events and Subscriptions are indeed how you would go about this. (https://www.opendental.com/site/apisubscriptions.html)

1. Send a Subscriptions POST request similar to below: (Note the trailing '/')

Code: Select all

{
"EndPointUrl": "https://webhook.site/.../",
"WatchTable": "Appointment",
"PollingSeconds": 60
}
2. Send an API request that changes an appointment, such as Appointments PUT Confirm.

3. Wait up to the amount of time specified as "PollingSeconds" to receive back the Event. The JSON will appear the same as if you ran an Appointments GET request.

We were able to successfully use the Webhook.site website as an EndPointUrl. It is worth noting that the returned list will be for any changes made to an appointment, not just AptStatus.

rinse-dental
Posts: 10
Joined: Wed Apr 06, 2022 12:04 pm

Re: How to: Post to public webhook?

Post by rinse-dental » Mon May 16, 2022 12:27 pm

Thanks. 2 clarifying question before I keep trying...
  • Does the change to the appointment need to be from the API or will API Events fire regardless of change type (e.g. user changes apt status in Open Dental vs. API changes apt. status)?
  • Does the endpoint need to be local or in a private network? I'm assuming not; however, webhook.site is an easy way to test and I'm not sure why this wouldn't be working.

SLeon
Posts: 146
Joined: Mon Mar 01, 2021 11:00 am

Re: How to: Post to public webhook?

Post by SLeon » Mon May 16, 2022 1:25 pm

1. The change to the appointment can be done within Open Dental or via the API.

2. The endpoint does not need to be local. We were able to use webhook.site successfully.

It is worth noting that Open Dental has to be running to send the results.

rinse-dental
Posts: 10
Joined: Wed Apr 06, 2022 12:04 pm

Re: How to: Post to public webhook?

Post by rinse-dental » Mon May 16, 2022 2:41 pm

Boom, got it! Thanks!

Post Reply