I need to download MIME contents from Outlook API in Microsoft Graph. All other requests are completely fine, but endpoint for fetching the MIME message sometimes takes too much time.
Documentation https://learn.microsoft.com/en-us/graph/outlook-get-mime-message
Endpoint I use https://graph.microsoft.com/v1.0/me/messages/{messageId}/$value
Way I call it
await _graphClient.Me.Messages["MailIdGoesHere"].Content.Request().GetAsync()
Logs for messages that take unusual time to download compared to their sizes
- 8347 bytes, downloaded in 4.2139115 seconds
- 8566 bytes, downloaded in 5.1931696 seconds
- 5891 bytes, downloaded in 8.2277588 seconds
But not all messages are slow. Bigger messages are downloaded in less time compared to these unusual ones
- 83614 bytes, downloaded in 0.2658916 seconds
- 154325 bytes, downloaded in 0.3164563 seconds
I tried to batch these requests by maximum allowed number in API (20 at the moment), and result didn't change. Parsing the response messages take too much time in the end and eventually total duration is not affected.
Is there some other way to get raw MIME content of the mails in Outlook API or is it a known issue?