Return Code for Webhook - retention time OD

For requests or help with our API
Post Reply
joergzastrau
Posts: 39
Joined: Sun Feb 27, 2022 2:53 am

Return Code for Webhook - retention time OD

Post by joergzastrau » Sat Aug 17, 2024 10:35 am

Dear all,

We currently respond to a webhook immediately with 200 (ok) and deal with errors afterwards on our own (polling). However, OD seems to resend the events if there is no response. Will this survive a reboot of OD? If so, I would only want to return a 200 response code if the processing was successful.

Is this correct?

With best regards

Joerg

SLeon
Posts: 558
Joined: Mon Mar 01, 2021 10:00 am

Re: Return Code for Webhook - retention time OD

Post by SLeon » Sat Aug 17, 2024 12:40 pm

Good afternoon,

Short answer: Yes, they will survive a reboot.

The general flow of our API Events is as follows:
  1. Store the current time for the database's server.
  2. Examine the Subscription.DateTimeStart and use it to query the desired table. We limit batches to 1000 elements.
  3. Create a payload and send the webhook to your site.
  4. We receive a response from your site.
If the response is not 200 OK:
  1. Processing of the subscription stops entirely.
  2. We will try to send it again after processing all other subscriptions the dental office may have.
If the response is 200 OK:
  1. If more than 1000 elements need to be send, we make subsequent payloads and send them.
  2. When all elements are sent, the Subscription.DateTimeStart is updated to the date stored at the beginning.
Effectively, the API Event states are stored in the database via the DateTimeStart. Open Dental does not consider data for a period of time "Sent" until DateTimeStart has been updated past that period of time. This helps prevent data loss when there are connection issues at the dental offices, downage of your webhook site, power outages, etc.

joergzastrau
Posts: 39
Joined: Sun Feb 27, 2022 2:53 am

Re: Return Code for Webhook - retention time OD

Post by joergzastrau » Sun Aug 18, 2024 5:56 am

Thanks for the clarification!

This is very comfortable as is the fact that one can have multiple subscriptions for the same event. Well done and well behaved!

Joerg

Post Reply