Sharepoint Online: Sharepoint Rest API

Yichen Name 86 Reputation points
2022-12-07T12:42:50.913+00:00

When we are trying to get data from SharePoint Online via SharePoint Rest APIs, it is getting throttled after fetching 300-400 objects (Files). For fetching a file and its associated metadata, we are making ~8 API Calls. After a few minutes we are receiving HTTP 429 (Throttling). Even after the retrying the calls after the given amount of time in the Retry-After Header, it is getting stuck. It doesn't give any error, nor it gives proper response.

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-12-08T01:48:32.357+00:00

    Hi @Yichen Name
    HTTP 429 indicates the calling application sent too many requests in a time window and exceeded a predetermined limit. In this case, a Retry-After header is included in the response indicating how long the calling application should wait before retrying or making a new request. Throttled requests count towards usage limits, so failure to honor Retry-After may result in more throttling. You can use RateLimit HTTP headers to avoid Throttling

    HTTP/1.1 429 Too Many Requests  
    Retry-After: 31  
    RateLimit-Limit: 1200  
    RateLimit-Remaining: 0  
    RateLimit-Reset: 31  
    

    For more details you can refer to the document
    https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#how-to-handle-throttling


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.