Skip to main content
The First Step
Aug 2, 2022 2:44 PM UTC
Solved

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

PhongVu
PhongVuAnswer
Community Manager
Aug 2, 2022 9:27 PM UTC

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

4 replies

xaranaThe First StepAuthor
The First Step
Aug 2, 2022 2:49 PM UTC

Here is the API response:

1659451794095.png

PhongVu
Community Manager
PhongVuAnswer
Community Manager
Aug 2, 2022 9:27 PM UTC

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

xaranaThe First StepAuthor
The First Step
Aug 2, 2022 9:37 PM UTC

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.

1659476255559.png

xaranaThe First StepAuthor
The First Step
Aug 2, 2022 9:38 PM UTC

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