Webhook not getting triggerred for API Subscriptions

For requests or help with our API
Post Reply
vinayaka2000
Posts: 7
Joined: Fri Nov 11, 2022 1:05 am

Webhook not getting triggerred for API Subscriptions

Post by vinayaka2000 » Fri Nov 11, 2022 1:11 am

Hello Team,
I am using the POST API Subscriptions API to create a subscription for Appointment table. I have made a post call using the below details :

Code: Select all

{
    "EndPointUrl": "https://webhook.site/...",
    "WatchTable": "Appointment",
    "PollingSeconds": 5
}
And I'm able to get a list of details of the subscriptions using the GET API.

And I made changes to an existing appointments using PUT Appointment API.

But, the webhook at webhook.site is not getting triggered even after a couple of hours.

Can you please let me know what might be the issue here?

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

Re: Webhook not getting triggerred for API Subscriptions

Post by SLeon » Fri Nov 11, 2022 8:22 am

Good morning,

Open Dental has to be running to process subscriptions and send events. The API Service will also do this, if you have it installed.

Do you experience this issue when either of the above are running?

vinayaka2000
Posts: 7
Joined: Fri Nov 11, 2022 1:05 am

Re: Webhook not getting triggerred for API Subscriptions

Post by vinayaka2000 » Mon Nov 14, 2022 1:24 am

Hello, thanks for the reply.
Yes, the API service has been installed in OD, and though I'm able to confirm that the webhook got added successfully, it doesn't seem to get triggered when a patient or appointment record is changed even though OD is running

justine
Posts: 169
Joined: Tue Dec 28, 2021 7:59 am

Re: Webhook not getting triggerred for API Subscriptions

Post by justine » Mon Nov 14, 2022 2:52 pm

vinayaka2000 wrote:
Mon Nov 14, 2022 1:24 am
Hello, thanks for the reply.
Yes, the API service has been installed in OD, and though I'm able to confirm that the webhook got added successfully, it doesn't seem to get triggered when a patient or appointment record is changed even though OD is running
Hello vinayaka2000,

Just for clarification, lets make sure everything is setup correctly.

When you run subscriptions GET, what values are you getting for WatchTable, PollingSeconds, UiEventType, DateTimeStart, and DateTimeStop?

Please verify that your EndPointUrl matches your webook.site.
webhook.site url.jpg
webhook.site url.jpg (101.35 KiB) Viewed 1830 times

vinayaka2000
Posts: 7
Joined: Fri Nov 11, 2022 1:05 am

Re: Webhook not getting triggerred for API Subscriptions

Post by vinayaka2000 » Wed Nov 16, 2022 3:34 am

Hello,
I have verified that the endpoint URL given to the API matches the webhook.site URL.
Please find details below :

Request body while creating a new subscription :

Code: Select all

{
    "EndPointUrl": "https://webhook.site/<custom webhook id>/",
    "WatchTable": "Appointment",
    "PollingSeconds": 5
}
Response of GET Subscriptions :

Code: Select all

{
        "SubscriptionNum": 7,
        "EndPointUrl": "https://<same custom webhook id as above>/",
        "Workstation": "",
        "CustomerKey": "<customerKey>",
        "WatchTable": "Appointment",
        "PollingSeconds": 5,
        "UiEventType": "",
        "DateTimeStart": "2022-11-15 08:03:38",
        "DateTimeStop": "0001-01-01 00:00:00",
        "Note": ""
    }

Updating the appointment table manually using postman for the web hook to trigger :

Code: Select all

/api/v1/appointments/<appointmentId>/Confirm
Request body for updating appointment :

Code: Select all

{
"confirmVal":"Confirmed"
}

justine
Posts: 169
Joined: Tue Dec 28, 2021 7:59 am

Re: Webhook not getting triggerred for API Subscriptions

Post by justine » Wed Nov 16, 2022 11:24 am

Hello vinyaka2000,

Thank you for verifying the above information. A few questions.

What version of Open Dental are you running?

I see in your response for GET subscriptions that the SubscriptionNum is 7. Have you deleted all other subscriptions you're not using?

If you repeatedly call GET subscriptions, does SubscriptionNum 7's DateTimeStart value increment by the PollingSeconds value?

DateTimeStart updating in polling seconds increments would indicate that either Open Dental or API Service is running.

When using PUT appointments Confirm to test, does the appointment that you are confirming have a confirmed value other than "Confirmed"?

vinayaka2000
Posts: 7
Joined: Fri Nov 11, 2022 1:05 am

Re: Webhook not getting triggerred for API Subscriptions

Post by vinayaka2000 » Mon Nov 21, 2022 4:00 am

Hello, thanks for the revert !

Please find details below :

The version of OD currently running in sandbox env is : 22.3.24.0

Have you deleted all other subscriptions you're not using - Yes

If you repeatedly call GET subscriptions, does SubscriptionNum 7's DateTimeStart value increment by the PollingSeconds value - Yes it gets incremented every time by value of polling_seconds

When using PUT appointments Confirm to test, does the appointment that you are confirming have a confirmed value other than "Confirmed" - No, only allowed value for the "PUT appointments - confirm" API is "Confirmed"

justine
Posts: 169
Joined: Tue Dec 28, 2021 7:59 am

Re: Webhook not getting triggerred for API Subscriptions

Post by justine » Mon Nov 21, 2022 8:14 am

vinayaka2000 wrote:
Mon Nov 21, 2022 4:00 am
Hello, thanks for the revert !

Please find details below :

The version of OD currently running in sandbox env is : 22.3.24.0

Have you deleted all other subscriptions you're not using - Yes

If you repeatedly call GET subscriptions, does SubscriptionNum 7's DateTimeStart value increment by the PollingSeconds value - Yes it gets incremented every time by value of polling_seconds

When using PUT appointments Confirm to test, does the appointment that you are confirming have a confirmed value other than "Confirmed" - No, only allowed value for the "PUT appointments - confirm" API is "Confirmed"
Hello vinyaka2000,

It sounds like you may have subscriptions set up correctly, but aren't performing an event that would cause the webhook to be triggered. If you are using PUT appointments Confirm on an appointment that already has a status of Confrimed, no changes have actually been made.

Using PUT appointments Confirm, try changing the confrimval to "None" then back to "Confirmed" to test your webhook.

vinayaka2000
Posts: 7
Joined: Fri Nov 11, 2022 1:05 am

Re: Webhook not getting triggerred for API Subscriptions

Post by vinayaka2000 » Wed Nov 30, 2022 9:19 am

hey justine,
It's working now.
The webhook is getting triggerred. Thanks a lot for the help !

Post Reply