Solved

Purpose of webhook expiration

  • 26 February 2020
  • 1 reply
  • 1218 views

This is a somewhat broad question, but why do webhooks expire? Is there some security aspect for this?

Also, the docs here (https://developers.ringcentral.com/guide/notifications/manual/webhooks ) are a bit unclear. Under the "Create Webhook Renewal Event Filter" section, is it saying that we can create a webhook both for some random thing AS WELL AS the renewal event? So if I want a webhook for X, I really need two webhooks, one for X, and one to listen for when it expires so I can renew it. That feels like a burden for the developer. I've never seen (although it surely doesn't mean it doesn't exist) a webhook that acts in this manner and unless there is a real good reason for it, I'd love to see the option to specify that a webhook doesn't expire.

icon

Best answer by Phong1426275020 26 February 2020, 16:51

View original

1 reply

Userlevel 1

First of all, when subscribe for a webhook notification, you can set the expireIns param to 630720000 seconds (which is 20 years) so it's kinda never expires.

If a webhook expired (Suspended status), you can use the webhooks renew API to renew it instead of resubscribing a new webhook subscription. Remember that the max numbers of subscription is 20 per account.

You don't need 2 webhooks X and Y to listen for an event when a subscription expires. Instead, when you set the expireIns param, you should remember that your webhook will expire after XXX secs, then either you can implement a timer to renew it, or periodically check the status of your webhook subscription (using the subscription id returned when you subscribe) to renew it if the status is "Suspended"

Lastly, why webhook expires? It is not a must feature by "standard", but it's really up to the services and service providers to secure and manage their resources. We do not want to keep sending out POST requests to services that could be no longer up and running or interested in receiving data.

So just simply set the expireIns to control your webhook subscription life time.

Reply