Share via

Microsoft.Identity.Client latest is not returning expected value

Dinesh K 20 Reputation points
2024-03-18T11:10:25.0933333+00:00

While returning the MessageCollectionResponse through MS graph client, why attachments are not reading by default. Then, how to get attachments with a message. In mail, I'm having attachments, but not in message collection.User's image

Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

CarlZhao-MSFT 46,456 Reputation points
2024-03-19T09:29:09.1266667+00:00

Hi @Dinesh K

Attachments are not a basic property of the message endpoint and are not returned when you get the message, but you can extend the attachment endpoint when you get the message.

var result = await graphClient.Me.Messages["{message-id}"].GetAsync((requestConfiguration) =>
{
	requestConfiguration.QueryParameters.Expand = new string []{ "attachments" };
});

User's image

Hope this helps.

If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.