question

AbounajaIPITDepartment-5421 avatar image
0 Votes"
AbounajaIPITDepartment-5421 asked ·

how to fetch mail content without old mail data in ms graph mail api

Dear all,

We are using MS Graph API for a web application. we need to fetch all mails based on the conversationId, mails are replying with the same email they received. they will not delete the mail content when they replied. so the replied mail has the previous mail content.
the problem is when we fetching the mail using graph api, it will return the whole message (including the mail content they received ).
is there any way to get mail response without the previous mail content?

azure-active-directoryazure-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SaurabhSharma-msft avatar image
0 Votes"
SaurabhSharma-msft answered ·

Are you using 'me/messages' to pull your emails? You can use $top=1 along with ConvesationId filter to get the latest conversation from the returned result. For example -

 https://graph.microsoft.com/v1.0/me/messages/<Message ID>?$(filter=ConversationId eq <Conversation Id>)&$top=1
· 3 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

if we use $top parameter it will return only latest first result from the conversation, but the original message appears in the message body. i need to avoid the previous original message.

for example: A reply an email to B, i don't want to show the original email sent from B to A when i request the graph api

0 Votes 0 ·
SaurabhSharma-msft avatar image SaurabhSharma-msft AbounajaIPITDepartment-5421 ·

ok, got it. So you want to remove previous message body from "Content". I do not think of any specific command available to exclude it. I will update it here if I figure out anything.

1 Vote 1 ·

@AbounajaIPITDepartment-5421 I also suggest you to reach out to Microsoft Graph Community for better support on Microsoft Graph issues.


(Please don't forget to accept helpful replies as answer)


0 Votes 0 ·