question

chris-caselas4160 avatar image
chris-caselas4160 asked dipesh-patel6333 commented

[sandbox] Webhook creation failing - how do I resolve "Webhook is not reachable" error?

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

webhooks
1 |3000

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

Tyler Liu avatar image
Tyler Liu answered Tyler Liu commented
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. 
2 comments
1 |3000

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

chris-caselas4160 avatar image chris-caselas4160 commented ·
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?
1 Like 1 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
I am out of ideas. Let's wait for others to respond.
0 Likes 0 ·
karthika-cools4670 avatar image
karthika-cools4670 answered benjamin-dean commented
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

4 comments
1 |3000

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

chris-caselas4160 avatar image chris-caselas4160 commented ·
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.
1 Like 1 ·
ak avatar image ak commented ·
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. 
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
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.
0 Likes 0 ·
benjamin-dean avatar image benjamin-dean commented ·
I just tried in Sandbox and was able to create a Webhook successfully.
0 Likes 0 ·
benjamin-dean avatar image
benjamin-dean answered
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).
1 |3000

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

karthika-cools4670 avatar image
karthika-cools4670 answered
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 :-)
1 |3000

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

dipesh-patel6333 avatar image
dipesh-patel6333 answered dipesh-patel6333 commented
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.
3 comments
1 |3000

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

ak avatar image ak commented ·

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 the developer support team or create a support ticket.

0 Likes 0 ·
dipesh-patel6333 avatar image dipesh-patel6333 commented ·
App is still on DEV environment and we are facing the issue with approval due to this.
0 Likes 0 ·
dipesh-patel6333 avatar image dipesh-patel6333 commented ·
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.
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