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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,344 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 45,921 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.

    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 Answers by the question author, which helps users to know the answer solved the author's problem.