question

Mark Hammans avatar image
Mark Hammans asked Mark Hammans commented

Using WebHook Renewal Event Filter

I set up a WebHook and that is working fine, and I set up a Renewal Event Filter when creating the subscription.

/restapi/v1.0/subscription/~?threshold=15&interval=5

I receive the first webhook call with this as the event, but I dont understand what the documentation means about a Put to the webhook endpoint

I can of course call Renew the normal way but that doesnt seem to cause subsequent calls to the webhook with the expiration event


Update & Renew a Webhook

To update a webhook, make a PUT call to the webhook endpoint with the required event filters specified in the request body. Each PUT call, either sent with the event filters or with an empty body, automatically renews the subscription, updating its expiration time.

The renew a webhook, you can also make a POST call to the subscription renew endpoint.


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 Mark Hammans commented

This params "threshold=15&interval=5" will set a reminder to notify your app when your webhook is about to expire.

Let's say you have subscribed successfully for a webhook notification for inbound fax events

POST "/restapi/v1.0/subscription"
{ 
   eventFilters:[
    "/restapi/v1.0/account/xxxxx/extension/yyyyy/fax?direction=Inbound"
   ],
   ...
}

And you get the subscription id "ed329ec1-0600-4560-b6dc-c764399e9a54"

Later on, you also want to receive SMS notification for that extension. You should avoid creating a new subscription. Instead, you can update the inbound fax notification to notify also SMS event. This is when you will need to update your existing subscription with the PUT method

PUT "/restapi/v1.0/subscription/ed329ec1-0600-4560-b6dc-c764399e9a54"
{
   eventFilters = [
    "/restapi/v1.0/account/xxxxx/extension/yyyyy/fax?direction=Inbound",
    "/restapi/v1.0/account/xxxxx/extension/yyyyy/message-store/instant?type=SMS"
   ]
}

Now, your webhook will get notification for Inbound faxes and instant SMS.

After some time, your webhook expires (you will receive reminders if you set the threshold and interval). This is when you will need to renew your existing subscription. You can renew an existing subscription in 2 ways.

POST "/restapi/v1.0/subscription/ed329ec1-0600-4560-b6dc-c764399e9a54/renew"
// OR
PUT "/restapi/v1.0/subscription/ed329ec1-0600-4560-b6dc-c764399e9a54"

Both ways without the body payload.

Hope this helps.

1 comment
1 |3000

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

Mark Hammans avatar image Mark Hammans commented ·

Thanks for taking the time to respond. I did figure out how to do the renew shortly after posting this message.


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