question

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

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

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

Please read the response body out. The body contains detailed explanation about the failure reason
1 |3000

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 |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
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 |3000

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"}]}
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.

Tyler Liu avatar image Tyler Liu ♦ commented ·
Could you please send me the webhook url tyler.liu@ringcentral.com ? I would like to have a try.
0 Likes 0 ·
Oleg Zaiat avatar image Oleg Zaiat commented ·

Why I can't create a subscription for a webhook anymore, a week ago everything goes well? Even the incoming request, to check the address/endpoint, don't come anymore.


I've check and I defenetly can hit the address/endpoint from external.

0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ Oleg Zaiat commented ·

Please create a ticket here https://developers.ringcentral.com/support/create-case

Do include the error message

0 Likes 0 ·
Tyler Liu avatar image
Tyler Liu answered Tyler Liu commented

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:


  • Self-signed SSL certificates are being blocked:


  • Proxy configured incorrectly


  • Request timeout:



I think it is an SSL issue.

Sandbox works because sandbox doesn't require SSL at all.


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.

Oleg Zaiat avatar image Oleg Zaiat commented ·

Before the SSL and certificate first of all you should have the incoming socket connection.

0 Likes 0 ·
Oleg Zaiat avatar image Oleg Zaiat commented ·

By the way, regarding to self-signed certificate:

where is the Settings > General menu is located ?

0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ Oleg Zaiat commented ·

Disregard that reply. It was posted 3 years ago and it was copied from some web page. I don't think it is referring to RingCentral settings.

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