Skip to main content
The First Step
January 17, 2023
Question

Validation Token is not set on webhook event anymore

I have a subscription set up for a webhook to call a url on the Instant Message event (/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS).
When I first create the subscription, the webhook URL is called, and I can confirm at this time that a Validation Token is present, and I am able to establish the subscription.
If I check the Subscription list at this point, I see that my subscription/webhook is active.

When I send a text message to my number, the url is being called by the webhook (as expected), but there is no Validation Token present, so obviously I can't validate to continue the process and receive the POST data.

I have had a subscription / webhook active for this event for the last 1.5 years and it has worked without issue, until 7 days ago when it just stopped working. After investigating I was able to figure out the above (no Validation Token is present anymore).

I've tried removing and creating a new subscription, confirmed the permissions in the app in the developer portal, and I've also tried creating a new app in the developer portal.

If anyone might be able to shed some light on this issue that would be very appreciated. I've contacted Ring Central support, but haven't received any response.

14 replies

New Participant
June 22, 2023

This is occurring in our Prod environment too. I can see that when we register the webhook (subscription) for the first time I can see "Validation-Token" in the header.
1687391736561.png
But, once set up is completed, the RingCentral invokes our prod endpoint without validation-token header.
1687391821638.png

This used to be working just fine few weeks back.

So, should we remove the logic that API's documentation recommends to send the validation-token in a request back in the response? Or what is the fix/workaround.

Thanks

PhongVu
Community Manager
Community Manager
June 22, 2023

Validation token is sent only once when you create a new subscription. Check out our code sample in the dev guide to implement your webhook notification.

The First Step
October 2, 2024


the initial validation token that you guys provides, shows up on create subscription. this is working.
https://developers.ringcentral.com/guide/notifications/webhooks/creating-webhooks
 

 @PhongVu the webhook validation token that the developer sets, should show, but it never shows
 https://developers.ringcentral.com/guide/notifications/webhooks/receiving
.
below is my setup (python)

subscription = self.platform.post(
"/restapi/v1.0/subscription",
{
"eventFilters": event_filters,
"deliveryMode": {
"transportType": "WebHook",
"address": get_webhook_url() + "/webhooks/ringcentral",
},
"validationToken": "my_random_token",
"verificationToken": "my_random_token2"

},
)

but the webhook request header shows an empty verification token.

'verification-token': ''


everything else in webhook works, except for the validation/verification token in the webhook header.

PhongVu
Community Manager
Community Manager
October 2, 2024


the initial validation token that you guys provides, shows up on create subscription. this is working.
https://developers.ringcentral.com/guide/notifications/webhooks/creating-webhooks
 

 @PhongVu the webhook validation token that the developer sets, should show, but it never shows
 https://developers.ringcentral.com/guide/notifications/webhooks/receiving
.
below is my setup (python)

subscription = self.platform.post(
"/restapi/v1.0/subscription",
{
"eventFilters": event_filters,
"deliveryMode": {
"transportType": "WebHook",
"address": get_webhook_url() + "/webhooks/ringcentral",
},
"validationToken": "my_random_token",
"verificationToken": "my_random_token2"

},
)

but the webhook request header shows an empty verification token.

'verification-token': ''


everything else in webhook works, except for the validation/verification token in the webhook header.

 

You wrote “the webhook validation token that the developer sets, ...”. No, developers do not set the webhook validation token. Developers set the “Verification Token” instead.

This is my fresh test.
// Subscription body

{

  eventFilters: [ '/restapi/v1.0/account/~/extension/~/message-store?type=SMS' ],

  deliveryMode: {

    transportType: 'WebHook',

    address: 'https://db13-67-169-xxx-xxx.ngrok-free.app/webhookcallback',

    verificationToken: 'ThisIsMySecrettoken'

  },

  expiresIn: 3600

}

 

// Event request headers

{

  host: 'db13-67-169-xxx-xxx.ngrok-free.app',

  'user-agent': 'RingCentral-WebHook',

  'content-length': '414',

  accept: 'application/json',

  'accept-encoding': 'UTF-8',

  'content-type': 'application/json; charset=UTF-8',

  'verification-token': 'ThisIsMySecrettoken',

  'x-forwarded-for': '199.255.122.132',

  'x-forwarded-host': 'db13-67-169-xxx-xxx.ngrok-free.app',

  'x-forwarded-proto': 'https'

}