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
C# SDK - Get X-Rate-Limit headers from response
Tags: rest api
Dec 10, 2019 at 2:39am   •   6 replies  •  0 likes
Angelo Bevilacqua

Using the RingCentral.Net SDK - how do retrieve the X-Rate-Limit-* headers from the responses ?

6 Answers
answered on Sep 30, 2021 at 11:38am  

@Carl McFarland Please go through below article about RingCentral .NET SDK 5 which supports extensions:

https://medium.com/ringcentral-developers/ringcentral-net-sdk-5-0-and-its-extensions-2992a5dc5caa

Check the Events extension:

https://github.com/ringcentral/RingCentral.Net/tree/master/RingCentral.Net.Events


 0
on Sep 30, 2021 at 12:27pm   •  0 likes

I will try this and report back. Thank you for quick reply.

answered on May 12, 2021 at 2:26pm  

RingCentral .NET SDK 5.x has major changes and there are many source breaks. It supports SDK extensions mechanism. And to catch the events, create and install the EventsExtension as shown below:

RestClient rcsdk = new RestClient(RC_CLIENTID, RC_CLIENTSECRET, RC_PRODUCTION);
rcsdk.Authorize(RC_USERNAME, RC_EXTENSION, RC_PASSWORD).Wait();
var eventsExtension = new EventsExtension();
rcsdk.InstallExtension(eventsExtension).Wait();
eventsExtension.RequestSuccess += EventHandler;
...
static void EventHandler(object sender, HttpMessages httpMessages)
{
    var rateLimitRemaining = httpMessages.httpResponseMessage.Headers.First(i => i.Key == "X-Rate-Limit-Remaining").Value.First();
    Console.WriteLine("Remaining: " + rateLimitRemaining);
}

 1
on Sep 30, 2021 at 11:27am   •  0 likes
  1. var eventsExtension = new EventsExtension();

What do I have to do to make it work for EventsExtension as I am getting an error to create a namespace for it. Do I have to install some package from Nuget?

What do you mean by "create and install the EventsExtension as shown below: ". Can you clarify this?

on May 12, 2021 at 3:01pm   •  0 likes

I will try this and report back.

answered on May 12, 2021 at 1:16pm  

This does not work in RingCentral.net SDK version 5.2. The AfterHTTPCall event does not exist.


 0
answered on Apr 29, 2021 at 3:09pm  

Hi Phong Vu,

I don't see AfterHttpCall in my ringcentral DLL. (Assembly RingCentral.Net, Version=1.0.0.0)

I am using Nuget Packaage.


Am I missing something...


 0
on Apr 30, 2021 at 11:42am   •  0 likes

What version of the RingCentral .NET SDK do you use?

answered on Dec 10, 2019 at 4:32am  

 1
answered on Dec 10, 2019 at 7:58am  

Using the RingCentral .Net SDK, you can check API limit header as shown below:

static RestClient rcsdk;

static void Main(string[] args)
{
  rcsdk = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_PRODUCTION);
  rcsdk.Authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD).Wait();
  rcsdk.AfterHttpCall += EventHandler;
}
static void EventHandler(object sender, HttpCallEventArgs eventArgs)
{
  var rateLimitRemaining = eventArgs.httpResponseMessage.Headers.First(i => i.Key == "X-Rate-Limit-Remaining").Value.First();
  Console.WriteLine("Remaining: " + rateLimitRemaining);
}

 0



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