question

Xavier Arana avatar image
Xavier Arana asked Phong Vu commented

Cannot subscribe WebHook, it always responds with "WebHook responds with incorrect http status."

Hello following this guide to subscribe a webhook: https://developers.ringcentral.com/guide/notifications/webhooks/quick-start#c#

When I try to run the two services, I always get the same error:

Content: {"errorCode":"SUB-522","message":"WebHook responds with incorrect HTTP

status. HTTP status is 502","errors":[{"errorCode":"SUB-522","message":"WebHook

responds with incorrect HTTP status. HTTP status is 502","status":"502"}],"statu

s":"502"}

This is my webhook server code: the same as the example,

1659451285460.png

and this is my webhook subscription code:

1659451366526.png


Seeing the message response, is my webhook server wrong, Do I need another step for it to work.

Here are the steps that I am using :

1. run webhookServer

2. run ngrok.

3. paste ngrok url into webhook subscription

4. run

webhooks
1659451285460.png (56.6 KiB)
1659451366526.png (60.1 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 Phong Vu commented

Check your ngrok port and the default port in your Webhook-server project. They should be the same port.

6 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.

Xavier Arana avatar image Xavier Arana commented ·

Yes, thanks for your answer, that was the problem of that, but now the post subscription happens with a 200 code, and after that if I send a message, I should be able to see it in the console from the C# example right?

https://developers.ringcentral.com/guide/notifications/webhooks/quick-start#c#

But it always comes Null or "", do I am missing something, do I need to add more code, thanks for your time, here you can see that I was able to subscribe to the webhook.

1659476280344.png

0 Likes 0 ·
1659476280344.png (1.7 KiB)
Phong Vu avatar image Phong Vu ♦♦ Xavier Arana commented ·

Change this line. There is some change to the StreamReader lib.

var str = await reader.ReadToEndAsync();
Console.WriteLine(str);
0 Likes 0 ·
Xavier Arana avatar image Xavier Arana Phong Vu ♦♦ commented ·

Hello, thanks again, I already have it like that

str = await reader.ReadToEndAsync();

Console.WriteLine(str);

or it is for me to change that line of code?

0 Likes 0 ·
Show more comments
Xavier Arana avatar image
Xavier Arana answered

Here is the API response:

1659451794095.png


1659451794095.png (24.8 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.

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