question

Raymond Camden avatar image
Raymond Camden asked Phong Vu commented

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.

rest api
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered Phong Vu commented

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
1 |3000

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

Raymond Camden avatar image Raymond Camden commented ·

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 ·
Phong Vu avatar image Phong Vu ♦♦ Raymond Camden commented ·

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 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys