Forum Discussion

Matt_Gauthier's avatar
7 years ago

Put Rate Limit related data into response for REST API calls

I was testing the new rate limiting feature that was to be rolled out v99 and enacted in v100.  Turns out Powershell throws out the headers when calling the invoke-restmethod commandlet unless an exception is thrown - this would mean I need to re-write all of my REST API scripts in another language or change to invoke-webrequest.  It would make it to adapt to the rate limiting for us PowerShell users easier if this data was just included in the response content.

2 Replies

Replies have been turned off for this discussion
  • Sarah_Terry's avatar
    Icon for Product Manager rankProduct Manager

    @Matt Gauthier Thanks for the info - we'll look into this. In the meantime, perhaps you can just add logic to retry the request if the response status code is 429 (which will be returned if the request is unsuccessful because of rate limiting).

  • That's a great idea, too.  I've been fiddling with it for about an hour - it actually wasn't too hard to update my LM api call function to use invoke-webrequest, output the content as json, implement a check to avoid get rate limited - so may be moot for me now.  But I can imagine if people have PS scripts out there and haven't created functions/libraries for their api calls this would be a bigger headache.