question

Ivie O avatar image
Ivie O asked Ruben Valdez answered

Webhook subscription error C#

Hello,

I am getting an error on my webhook subscription.,

sub-521 WebHook is not reachable, even though I can see that the webhook is being invoked because it hits the breakpoint inside the if statement shown in attached; see error below that. I get a Status 200 Ok response when I invoke the webhook from PowerShell or Postman. I am using ASP.NET/C#. I've also included the subscription code. Thank you for your help.

rest api
1570450847657.png (81.0 KiB)
1570451053764.png (108.3 KiB)
1570451412644.png (106.0 KiB)
1 |3000

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

Phong Vu avatar image
Phong Vu answered Ivie O commented

The message "Webhook is not reachable" could meant the validateToken was not returned in time or not returned at all.

Did you follow the instructions exactly shown in this quick start? If not, try that.

You highlighted the error on line 45. If that is true, what is the error details?

1 comment
1 |3000

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

Ivie O avatar image Ivie O commented ·

The setup I have is based on the quick start guide. There are three attachments in my original post. The first is the webhook, the second is the detailed error, the third is the subscription. I do see the verificationToken in the webhook but perhaps it is not returned on time. I notice a small delay (about 2 secs) after the request to create subscription is invoked. My understanding is the verificationToken must be returned within 1 sec. Is there something I need to do to ensure timely return of verificationToken?

0 Likes 0 ·
Ivie O avatar image
Ivie O answered Phong Vu commented

It works when I create the webhook project from the command line (dotnet new web). I am only seeing that error when I create the web project in Visual Studio (empty template).

1 comment
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

Great! But that's weird. I will try to replicate the problem and find the root cause to fix when I have time.

0 Likes 0 ·
Ruben Valdez avatar image
Ruben Valdez answered

Hello, I found the same problem , the solution for me was put the StreamReader in a Task.Run and use await for waiting the reader.

1 |3000

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