question

matt-resmer13992 avatar image
matt-resmer13992 asked Tyler Liu answered

Can't create webhook subscription in production mode

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
General Topic
1 |1500 characters needed characters left characters exceeded

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
"400 Bad Request result"

Please read the response body out. The body contains detailed explanation about the failure reason
1 |1500 characters needed characters left characters exceeded

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

matt-resmer13992 avatar image
matt-resmer13992 answered
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()
1 |1500 characters needed characters left characters exceeded

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
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
1 |1500 characters needed characters left characters exceeded

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

matt-resmer13992 avatar image
matt-resmer13992 answered Tyler Liu commented
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"}]}
1 comment
1 |1500 characters needed characters left characters exceeded

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

Could you please send me the webhook url tyler.liu@ringcentral.com ? I would like to have a try.
0 Likes 0 ·
Tyler Liu avatar image
Tyler Liu answered
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.

1 |1500 characters needed characters left characters exceeded

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

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