- Not sure you're using Microsoft Graph SDK? IF yes, they already have implement handlers that rely on the Retry-After header or default to an exponential backoff retry policy.
- But before that you need to remember that the attachment limits set at your end, the user can't keep on sending attachments. Graph API documentation specifies that this limit applies to the attachment and message resources.
Microsoft Graph API Retry-After is not exposed in browser
We're using Graph API from office-js addin to send messages. Sometimes the user is sending many attachments and our app is getting throttled. In the response there is a Retry-After header, sometimes for a long time like 3 minutes. The problem is that since our code run in a browser, we can't access the Retry-After header since it is not exposed. The header that should expose it only expose these headers:
ETag, Location, Preference-Applied, Content-Range, request-id, client-request-id, ReadWriteConsistencyToken, SdkVersion, WWW-Authenticate
Retry-After is missing.
Microsoft 365 and Office Development Office JavaScript API
Microsoft Security Microsoft Graph
2 answers
Sort by: Most helpful
-
Deva-MSFT 2,271 Reputation points Microsoft Employee
2021-08-13T03:19:12.41+00:00 -
Amiram Korach 1 Reputation point
2021-08-16T14:32:24.89+00:00 Thanks @Deva-MSFT . I'm not using Graph SDK but just making http requests. I already implemented my own retry handler that relies on the Retry-After header with a fallback to exponential backoff. We are limiting the user with the upload speed already. We get many 429 errors for mailbox concurrency limit, but according to docs we should be able to make 4 in parallel, and practically even 2 calls get blocked. Using an SDK won't help because the browser hides the Retry-After header since it is not in the Access-Control-Expose-Headers as I wrote, so the SDK won't no about that either. Exponential backoff won't help since it is a very long time sometimes. We just need this header to be exposed.