News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Using WebHook Renewal Event Filter
Tags: rest api
Jun 26, 2020 at 9:58pm   •   1 replies  •  0 likes
Mark Hammans

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.


1 Answer
answered on Jun 27, 2020 at 7:52am  

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



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us