[sandbox] Webhook creation failing

  • 1
  • Problem
  • Updated 10 months ago
  • Not a Problem
I'm using the Ruby SDK to make a POST request to create a subscription in the sandbox environment. The WebHook address is a local tunnel to my local app server, and I see the request coming through and responding with 200 OK.

Here's the error I'm getting from the request to the subscription API:

SUB-521 WebHook is not reachable

It is reachable, and the request is completing, after successfully sending the Verification-Token header. (Otherwise I would be getting SUB-520 I believe.)

Any clues what's going wrong? Is there some sort of payload it is expecting to receive beyond the Verification-Token?

Additional info:

request uri => https://platform.devtest.ringcentral.com/restapi/v1.0/subscription
app key => nDaskd-URlGBOsj0N4Ilnw
Photo of Chris Caselas

Chris Caselas

  • 140 Points 100 badge 2x thumb
  • frustrated.

Posted 1 year ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,342 Points 5k badge 2x thumb
Have you read the doc here: https://github.com/ringcentral/ringcentral-api-docs/blob/master/docs/webhooks.md#create-a-webhook-ur... ?

The webhook URL service must meet the following requirements:
  1. is available on the Internet
  2. has a TLS / SSL enabled*
  3. can respond within 1000 milliseconds
  4. will respond with Validation-Token header on subscription
Please make sure that webhook url meets all the requirements above. 
Photo of Chris Caselas

Chris Caselas

  • 140 Points 100 badge 2x thumb
Yes, I have read through the docs.

  1. The request is coming through successfully, via the internet.
  2. SSL is enabled, and I see the request successfully being made via the https protocol. (Though I believe in Sandbox this isn't even required?)
  3. From the server perspective, the response is around ~50 ms each time.
  4. I am indeed capturing and returning the `Validation-Token`. If I weren't, I believe it would return a different error. (SUB-520, from what I've seen on some other posts.)
Can you confirm that this error:

SUB-521 WebHook is not reachable

Is the result of one of the above conditions not being met? There's no other possible solution?
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,342 Points 5k badge 2x thumb
I am out of ideas. Let's wait for others to respond.
Photo of karthika cools

karthika cools

  • 96 Points 75 badge 2x thumb
I am too facing similar problem. 

  1. The request is coming through successfully, via the internet.
  2. Using ngrok for local tunnel
  3. From the server perspective, the response is around ~300 ms each time.
  4. I am indeed capturing and returning the 'Validation-Token'.(200 status)

Getting below response

{

  "errorCode" : "SUB-521",

  "message" : "WebHook is not reachable",

  "errors" : [ {

    "errorCode" : "SUB-521",

    "message" : "WebHook is not reachable"

  } ]

}


Till last week it was working in the same setup. Today only it is not working. 

Is there any issue in creating a subscription.

Could anyone help me

Thanks

Photo of AK

AK, Official Rep

  • 4,372 Points 4k badge 2x thumb
Hi Chris,

There seems to be no issues with creating Subscriptions, however I am able to replicate the error that you are seeing upon Webhook creation. 

I would update you once we get to the bottom of it. Thank you for your patience. 
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,190 Points 5k badge 2x thumb
To me it seems like RingCentral API server cannot access the WebHook url. As far as I can tell from your message, you have a local http server with no public address. And you use ngrok to get a public address. I had some bad experience with ngrok last week. Sometimes it just doesn't work, I couldn't even ping its hostname. 

Instead of using ngrok, could you please publish your app to some cloud service to have a try? For example, Heroku.
Photo of Chris Caselas

Chris Caselas

  • 140 Points 100 badge 2x thumb
Just going to add here that I am no longer having issues testing webhooks in local development, I haven't had any issues for quite some time.

Originally I was using a localtunnel that responded to https requests but it turns out it wasn't satisfying Ringcentral's strict TLS / SSL requirements. Once I switched to ngrok, everything worked as expected.

@karthika cools be sure to use the https url provided by ngrok.
Photo of Benjamin Dean

Benjamin Dean

  • 8,582 Points 5k badge 2x thumb
I just tried in Sandbox and was able to create a Webhook successfully.
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
I have this application (written in Node.js) which shows how to setup Webhooks and receive the event notifications from them properly.

https://github.com/bdeanindy/ringcentral-webhook-basics

Additionally, this has a one-button Heroku deployment (which makes it really easy to get started using/testing with this quickly).
Photo of karthika cools

karthika cools

  • 96 Points 75 badge 2x thumb
Thank you all for your prompt response. Today i am able to create subscription successfully in the same setup. What i just did is uninstall the ngrok and reinstalled and tried out :-)
Photo of Dipesh Patel

Dipesh Patel

  • 90 Points 75 badge 2x thumb
Hi, we are using server which is live and still getting  'SUB-521', message: 'WebHook is not reachable'. but thing is that if we try after 5 seconds it works perfectly fine.
Photo of AK

AK, Official Rep

  • 4,372 Points 4k badge 2x thumb
Dipesh,

I did experience this issue some time ago when I used a local tunneling service like  
ngrok.

Since you are using a Live server, and it appears that you have followed the strict TLS / SSL requirements that's strange to get that error. 

If you are still getting the same error. Could you please provide more details like:

1.) Webhook Created response ( after 5 seconds )
2.) API Request and Response 

You could send out an email to devsupport@ringcentral.com 
  
Photo of Dipesh Patel

Dipesh Patel

  • 90 Points 75 badge 2x thumb
App is still on DEV environment and we are facing the issue with approval due to this.
Photo of Dipesh Patel

Dipesh Patel

  • 90 Points 75 badge 2x thumb
We get error

{ errorCode: 'SUB-521',message: 'WebHook is not reachable',
errors: [ { errorCode: 'SUB-521', message: 'WebHook is not reachable' } ] }

This error always comes first time, whenever we subscribe webhooks.
On second call, it gets success.

Our process is that we ask user to complete OAuth authentication process and as soon as he completes and we get token we call POST subscribe api.