Sharepoint Online: Sharepoint Rest API

Yichen Name 66 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.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,708 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,678 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,606 Reputation points Microsoft Vendor
    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.