Articles on: CMS

Adding Webhook for Membership Events

Getting Started



Webhooks notify you when an event occurs on your website. Webhooks are particularly useful for asynchronous events like when a subscriber is added to your website, a new team member is added, a subscriber updates their email or name, subscriber purchases any paid plan, etc. This article will cover more details about how Webhooks work on Dorik.

Actions to be triggered



Upon adding a webhook URL to your site, you will receive calls for the following events:

Event NameWhen will it be triggered?
add-memberWhen any new user subscribes to the free plan
update-memberWhen an existing member updates their email or name.
remove-memberWhen a user is removed from the member list
add-subscriptionWhen a user purchases any paid plan
update-subscriptionWhen any paid member downgrades to a free plan or changes from annually to monthly or vice versa
cancel-subscriptionWhen a user cancels their subscription


💡 More actions will be added in the future with upcoming updates.

💡 When a webhook URL is added, and it is not validated on the first attempt, the system will automatically retry for validation

Let us look at each event being broken down into more details, refer to the doc below to see all the events being broken down:

Webhook Events for Membership in details

Add Webhook URL



To add a Webhook URL to your site, follow the steps shown in the GIF below:



⚠️  Make sure you add an HTTP or HTTPS protocol before your URL ⬇️



To Regenerate your Secret Key:



Edit or Delete your URL:



How to Verify Secret Key



➡️ When any Webhook request is received during an event, that request’s header X-Webhook-Token will have a secret token. This allows you to verify that the events were sent by Dorik, not by any third party.

The secret value in the header code will look something like this:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoid2ViaG9vay1wYXlsb2FkIiwiaWF0IjoxNjYzMjMyM********************************************gn03FP78

💡 You can verify this token with the secret key in your site’s Dashboard.

Updated on: 01/02/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!