MIME Type always returning as empty JSON (Graph SDK Mail)

Kyle Jeynes 0 Reputation points
2023-04-24T15:43:42.1866667+00:00

Following the documentation, I can successfully read emails from a shared mailbox. However, anytime I want to get the MIME content for an email to store as an EML, I get the following response:

Client error: GET https://graph.microsoft.com/v1.0/users/support@redacted.co.uk/mailFolders/inbox/messages/AAMkADg1NzY0NWQwLTEyOGUtNGMyNi05YTM0LWEy.REDACTED/$value resulted in a 405 Method Not Allowe` response: {"error":{"code":"ErrorInvalidRequest","message":"The OData request is not supported."}} If I use the /users/{id}/messages/{id}/$value endpoint I just get an empty JSON response.

How can I obtain the MIME type?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,715 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. TH-4749-MSFT 3,290 Reputation points
    2023-04-24T17:06:00.0666667+00:00

    Hello Kyle Jeynes, Thanks for reaching out. The api call https://graph.microsoft.com/beta/users/<User EmailAddress>/mailfolders/inbox/messages/<Message-ID>/$Value does not support returning Mime content of messages. I received the same error in my test environment for this api call. You can provide your feedback and suggestion regarding this feature at https://aka.ms/graphfeedback. I was however unable to reproduce the issue using the /users/{id}/messages/{id}/$value as this api call returned mime content. Does the issue occur with a specific message or specific mailbox? Does the account you are using to make Graph Api calls have appropriate permissions to the mailbox? Thanks.