Sid
Sid

Reputation: 491

The OData request is not supported when getting Outlook MIME Message

We are able to connect to Graph and Read Emails and folders. However , we also need to have Email's MIME message which needs to be saved in our Application as a proof of Approval and later can be downloaded as .eml file.

We referred to https://learn.microsoft.com/en-us/graph/outlook-get-mime-message and https://learn.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0&tabs=java#request-3 for making REST call.

However , the response we get is :

The OData request is not supported.

SdkVersion : graph-java/v2.3.1 Authorization : [PII_REDACTED]

API/ Permission added are Mail.ReadWrite with Admin consent and User.Read.

Are there ay more settings needed on the Graph API or any other way to get the MIME message ?

Thanks

Upvotes: 1

Views: 1419

Answers (1)

Sid
Sid

Reputation: 491

This was resolved . POST should be made like below

graphClient.users(userName).messages(msgId).content().buildRequest().get();

while I was making call to

graphClient.users(userName).mailFolders(folderId).messages(msgId).content().buildRequest().get();

Upvotes: 4

Related Questions