News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Trouble creating a Webhook with API in C#
Tags: sdk
Sep 19, 2018 at 8:29am   •   3 replies  •  0 likes
cole-bennington

I am trying to create a Webhook to be notified when a message is sent back to my account that I use for my server app. I initially send out messages and the final goal is functionality for when they reply for my app to be able to trigger another message to be sent.


I am using a password flow for authorization because this is a server app with no UI. I make a CreateSubscriptionRequest object for the request of the POST and give it eventFilters and a NotificationDeliveryModeRequest object with transportType and address. I then navigate to the subscription endpoint where I call the POST method with the CreateSubscriptionRequest object as its parameter and when the code gets to this point it returns an error saying "Call failed with status code 400 (Bad Request) POST https://platform.devtest.ringcentral.com/restapi/v1.0/subscription".


I'm not sure what the problem with the request is or if its something else that I cant figure out. If anyone has any ideas or the same issue please let me know. Thanks!

3 Answers
answered on Sep 20, 2018 at 7:58am  
https://ringcentral-quickstart.readthedocs.io/en/latest/webhooks/

  1. is available on the Internet
  2. has a TLS / SSL enabled*
  3. can respond within 1000 milliseconds
  4. will respond with Validation-Token header on subscription

It might because the WebHook server doesn't respond with HTTP status code 200. Please check the log on your WebHook server.


 0
answered on Sep 20, 2018 at 7:49am  
Thank you for your timely response. This is the error I seem to be getting

{"errorCode":"SUB-525","message":"WebHook server response is invalid","errors":[{"errorCode":"SUB-525","message":"WebHook server response is invalid"}]}

 0
answered on Sep 19, 2018 at 4:10pm  
Are you using https://github.com/ringcentral/ringcentral-csharp-client#exception-handling  ?

You can catch the exception and print the error response:

string errorMessage = fhe.GetResponseString(); 
Console.WriteLine(errorMessage);

 1



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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us