how to get the email trail using ms graph api

Dhruv Batra 0 Reputation points
2024-06-20T12:43:57.0466667+00:00

Hi Team,
Lets say
there is a user X and has had conversations with user Y
X: Hi, please share the data ( on 17th)
Y:PFA ( on 18th)
X:thank you ( on 19th)
Y:looking forward to work with you ( on 19th)

How can I get the entire mail trail from inception of the conversation ?

Community Center Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sourabh Gupta 800 Reputation points Microsoft External Staff
    2024-06-22T10:42:30.56+00:00

    HI Dhruv Batra,

    Thanks for reaching out.

    You first need to get the conversation id, that you can get from any message in the whole trail and try to get messages using the conversation id filter as mentioned in the following url

    https://graph.microsoft.com/v1.0/me/messages$select=conversationId,subject,from,body,receivedDateTime,id,hasAttachments,toRecipients,ccRecipients,bccRecipients,replyTo&$filter=conversationId eq '{conversation-id}'

    The response contains all the messages for that conversation.

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

    0 comments No comments

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.