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
Webhook source validation
Tags: ringcentral app, webhooks
Sep 5, 2022 at 4:36am   •   2 replies  •  0 likes
Nikolai Chashchin

Hi Community,

Whenever webhook notification is coming I would like to check that the source it is coming from is https://platform.devtest.ringcentral.com. I need it as a extra security measure. Can I rely on the IP address of https://platform.devtest.ringcentral.com for Sandbox and https://platform.ringcentral.com for production environment? Can I hardcode these (IPs) in my code?

Thanks!

Best,

Nikolai Chashchin


2 Answers
answered on Sep 5, 2022 at 7:31am  

Hi Phong,

Thanks for the tip.

I'm doing it. But is it possible to also check the ip? Or is it somehow dynamic?

Best,

Nikolai


 0
answered on Sep 5, 2022 at 6:49am  

For security, you don't verify the domain, but you should set the verification secret code and check it in the header. Here is an example

// Specify the secret token when creating your webhook notification
    ...
    deliveryMode: {
            transportType: "WebHook",
            address: DELIVERY_ADDRESS,
            verificationToken: "ThisIsMySecrettoken",
          },
    ...

// Print the headers upon receiving inbound any webhook message

console.log("HEADERS", req.headers)

// Print:

HEADERS {
  host: 'db41-42-119-224-213.ngrok.io',
  'user-agent': 'RingCentral-WebHook/8.3',
  'content-length': '849',
  accept: 'application/json',
  'accept-encoding': 'UTF-8',
  'content-type': 'application/json; charset=UTF-8',
  'verification-token': 'ThisIsMySecrettoken',
  'x-forwarded-for': '80.81.140.4',
  'x-forwarded-proto': 'https'
}

 0



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