question

Raymond Camden avatar image
Raymond Camden asked ·

Purpose of webhook expiration

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.

api
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

· Write an Answer
Phong Vu avatar image
Phong Vu answered ·

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.

2 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thank you for this, but let me ask, where is this documented? Specifically that when I make new webhook I can specify expiresIn? I don't see it here, https://developers.ringcentral.com/guide/notifications/manual/webhooks . Not here either: https://developers.ringcentral.com/guide/notifications/quick-start/webhook/node


I do see it defined here, https://developers.ringcentral.com/api-reference/Subscriptions/createSubscription . But the main docs really don't make this clear. :\

0 Likes 0 · ·

The quick start is a simple code and most of them implements just required params. Developers should also read the API reference to learn more about an API capabilities.

But thanks for your feedback! I will consider to add the expireIns param to the demo code to highlight it.

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.