-1

I am working with Microsoft Graph API to read and reply in a thread which is working fine.

Now my requirement is to read individual mail from a thread using conversation id.

Suppose we have a thread which contains 10 mails with some of them having attachments.

Now I want to extract each mail and its attachment if any from the thread for that I have conversation id.

Currently what is happening is I am getting complete HTML of the thread also I am not able to establish relationship between attachments and its original mail in the thread.

halfer
  • 19,824
  • 17
  • 99
  • 186
Rajnish Kumar
  • 2,828
  • 5
  • 25
  • 39
  • I think you are currently using [Get conversationThread](https://learn.microsoft.com/en-us/graph/api/conversationthread-get?view=graph-rest-1.0&tabs=http) to retrive info regarding particular conversation. Now with this call you will get if the conversation has attachment or not. If it is true you can try [List attachments](https://learn.microsoft.com/en-us/graph/api/post-list-attachments?view=graph-rest-1.0&tabs=http) which will give you attachment. Let me know if this helps. – AnkUser Aug 31 '20 at 08:14
  • Please use an English spell-checker when posting here. – halfer Sep 14 '20 at 23:37

1 Answers1

0

If you want to get all Email Messages in a Mailbox folder using a particular conversatationId that you could just use a simple filter

https://graph.microsoft.com/v1.0/me/messages?$filter=conversationId eq 'AAQkADJkZTNiN2ZlLTg2M2QtNGZjMC1hNDUxLTdlNjgzZDVjZDljMAAQAKVNpsZfVhlEtPFltSQuNJ8%3D'

(Make sure you escape the ConversationId correctly).

Now i want to extract each mail and its attachment if any from the thread for that i have conversatation id.

By extract do you mean export ? you could grab the Mime Content of each message using https://learn.microsoft.com/en-us/graph/outlook-get-mime-message .

Currently what is happening is i am getting complete HTML of the thread also i am not able to establish relationship between attachments and its original mail in the thread.

If your only looking at the latest message in the Thread it hard to put that into context because of way Email threading works but this is more a problem with medium. There are additional properties like the ConversationIndex https://github.com/microsoftgraph/microsoft-graph-docs/issues/8021 that can allow you to order the conversation messages (also the In-Reply-To Header property as well)

Glen Scales
  • 20,495
  • 1
  • 20
  • 23