No Retry-after in header

Nadjim 61 Reputation points
2022-07-11T13:40:10.06+00:00

Hi
I have just 2 questions.

When I have an error, for exemple : The operation failed because the request was throttled.

Its normal i don't have Retry-after in the header ?

And how to make the API call not encounter this problem because I wait X seconds is always the same problem in the following API call ?

My call : POST /me/drive/items/{item-id}/invite

Regards

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2022-07-12T00:28:55.29+00:00

    Hello @Nadjim , the Retry-After is not always included in a response. ** If no Retry-After header is provided by the response, **we recommend implementing an exponential backoff retry policy. You can also implement more advanced patterns when building large-scale applications.

    Microsoft Graph SDKs available for 7 programming languages already implement handlers that rely on the Retry-After header or default to an exponential backoff retry policy.

    Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it and complete the quality survey so that others in the community with similar questions can more easily find a rated solution.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-07-13T07:13:33.237+00:00

    Hi @Nadjim ,
    Per my research, I do agree with alfredorevilla-msft's answer. The Retry-After is not always included in a response. When we get 503 error there may be a Retry-After header in response.
    You can refer to following document
    https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/errors?view=odsp-graph-online


    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.


    0 comments No comments

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.