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,
and this is my webhook subscription code:
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
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.
Check your ngrok port and the default port in your Webhook-server project. They should be the same port.
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.
Change this line. There is some change to the StreamReader lib.
var str = await reader.ReadToEndAsync(); Console.WriteLine(str);
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?
That is the change I made compare to the old line ReadToEnd() and that ReadToEndAsync() works for me while the other one returns empty.
Remember when you test your app multiple times. Every time you subscribe for a new subscription, print out the subscription id and use it to delete the subscription before running a new test. Otherwise, you will soon end up in having too many active subscriptions and hit the limit.
To delete a subscription knowing the subscription id, call this endpoint
await restClient.Restapi().Subscription("subscription-id").Delete();
You were right Phong, thank you for everything, now it is working as intended.
If you don't mind, please accept the answer to help other members later one seeking for similar solution.
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder