News & Announcements User Community Developer Community

Welcome to the RingCentral Community

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

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
400 Bad Request Subscribing For WebHooks
Tags: getting started
Feb 11, 2019 at 3:41pm   •   5 replies  •  0 likes

Hi Guys,

I'm using the RestClient to set up a subscription for a WebHook, but I'm just getting a 400 Bad Request exception when call the method to create the subscription. The url I'm using is valid (I've replaced it with a placeholder in the following code for obvious reasons)

Working with a dev sandbox account. Can successfully get an access token and extension list

too so I know that part's working fine.

The iis logs of the WebHook location show it's never hit as part of this process either.

If anyone has any suggestions I'd love to hear them - Thanks ... here's the code ...

GetExtensionListResponse extensionList = await rc.Restapi().Account().Extension().List();

List<string> eventFilters = new List<string>();

foreach (GetExtensionInfoResponse infoResponse in extensionList.records)



Console.WriteLine($"Extension number / ID : {infoResponse.extensionNumber} / {}");




SubscriptionInfo subscriptionInfo = await rc.Restapi().Subscription().Post(new CreateSubscriptionRequest()


eventFilters = eventFilters.ToArray(),

deliveryMode = new NotificationDeliveryModeRequest()


transportType = "WebHook",

address = "

5 Answers
answered on Feb 11, 2019 at 7:12pm  
Phew, got it! ... Thanks so much for the help people :)

That last post of yours Brandon gave me the last couple of bits and pieces I needed, thanks

answered on Feb 11, 2019 at 5:17pm  
It's something else. And I'm not quite sure. I'm sure a RC expert can explain that a bit more. And maybe why the iis logs dont show anything. They're sending a specific RC user agent as well, not sure if that helps. For others that stumble across this thread... think of this flow webhook subscription flow like this: 1. You send a request to subscribe via webhook. 2. As soon as RC gets that request they send a POST api call with an empty api body and a 'validation-token' to the url you requested 3. If your webhook url is set up to respond with a 200 OK and the same 'valdiation-token' header in the response as was the request... you'll get a 200 OK from the call in step 1. 4. If you have a bad url... it times out... and/or doesn't echo that header back... you'll get a 4xx error

answered on Feb 11, 2019 at 5:15pm  
After you catch the exception, try to get more info out of it.

catch (FlurlHttpException fhe)  {      string errorMessage = fhe.GetResponseString();      Console.WriteLine(errorMessage);  }      If the exception you caught is not  FlurlHttpException, try to inspect its inner exception.

answered on Feb 11, 2019 at 4:12pm  
Hey, thanks Brandon.

No, it's not set up to do that yet. But shouldn't I still see a hit to that endpoint in the iis log?

Also, that 'validation-token' ... is that the VerificationToken that gets passed in as part of the subscription request or is it something else?

answered on Feb 11, 2019 at 4:08pm  
I'm curious... is your webhook listener set up to echo back the 'validation-token' header in the initial call response? I saw this error before and once I coded my webhook listener controller to echo back that header I started seeing success. (Be mindful tho... this header is only used on the initial call to validate your webhook endpoint) Check this out: Ring Central does this so they know your webhook is who you tell them it is... and not some random black hole they send data to.


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

Developer Platform
Integrated Apps
App Gallery
Developer support
Games and rewards

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