Can't create webhook subscription in production mode

  • 1
  • Problem
  • Updated 1 month ago
Hi Guys,

I've switched my application from development to production and changed appropriate credentials ... but I'm finding the WebHook subscription fails now even though it's exactly the same url that worked fine in development

I know I'm connecting to the production ring central url properly because I can establish a connection with the new credentials, receive an access token, get a list of the account's extensions etc

But, when I try and create my subscription, I get a 400 Bad Request result with exactly the same code, callback url that worked fine before

Is there something different that needs to be done with WebHooks in production mode?

Thanks for the help.

Matt
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb

Posted 1 month ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,568 Points 5k badge 2x thumb
"400 Bad Request result"

Please read the response body out. The body contains detailed explanation about the failure reason
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Thanks for replying Tyler.

I'm using your RestClient in csharp to do it. I don't receive any error from the Post method. I just get a 400 Bad Request exception and the contents of the exception don't give me any clue why ...

Flurl.Http.FlurlHttpException: Call failed with status code 400 (Bad Request): POST https://platform.ringcentral.com/restapi/v1.0/subscription
   at Flurl.Http.FlurlRequest.<HandleExceptionAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Flurl.Http.FlurlRequest.<SendAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Flurl.Http.FlurlRequest.<SendAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RingCentral.RestClient.<Post>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,568 Points 5k badge 2x thumb
We just release a new .NET SDK: https://github.com/ringcentral/ringcentral.net
With this new SDK it should be much easier to debug.

If you continued to use the old SDK, here is the code to print response body: https://github.com/ringcentral/ringcentral-csharp-client#exception-handling
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Fantastic, thanks Tyler ... I can see now that the RingCentral server seems to think my Web Hook url is unreachable (exception contents below). The thing is though, this same code/url works perfectly in the development sandbox.

Do Web Hook url domains need to be whitelisted in settings somewhere or something? I can hit that endpoint from a browser external to the domain too and it works fine ... so the endpoint's defintely live

{"errorCode":"SUB-521","message":"WebHook is not reachable","errors":[{"errorCode":"SUB-521","message":"WebHook is not reachable"}]}
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,486 Points 5k badge 2x thumb
Could you please send me the webhook url tyler.liu@ringcentral.com ? I would like to have a try.
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,568 Points 5k badge 2x thumb
Replied to you via email. There are issues with the webhook uri.

Could not get any response
There was an error connecting to <url omitted>.
Why this might have happened:
  • The server couldn't send a response:
    Ensure that the backend is working properly

  • Self-signed SSL certificates are being blocked:
    Fix this by turning off 'SSL certificate verification' in Settings > General

  • Proxy configured incorrectly
    Ensure that proxy is configured correctly in Settings > Proxy

  • Request timeout:
    Change request timeout in Settings > General


I think it is an SSL issue. 
Sandbox works because sandbox doesn't require SSL at all.