0
votes

I am trying to pull out the information around the file attachments in the mail in graph explorer , i have tried using it with every file type but it is specifically not working with Microsoft word documents which is around (30 MB).

https://graph.microsoft.com/v1.0/users/{mail-id}/messages/{message-id}/attachments

In this link it is able to get the message from the message ID , but while adding "/attachments" at the end of the link it is getting timeout .

1

1 Answers

0
votes

You can select the properties you need, so you can avoid downloading the whole content of the attachment.

https://graph.microsoft.com/v1.0/users/{mail-id}/messages/{message-id}/attachments/?$select=id,name,contentType

Code:

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var attachments = await graphClient.Users["{mail-id}"].Messages["{message-id}"].Attachments
    .Request()
    .Select("id,name,contentType")
    .GetAsync();