gad0lin
gad0lin

Reputation: 121

Microsoft Graph API - find message by internetmessageid

I need to find conversationId for email exchange between two user - John and Harry. In my scenario:

  1. John sends message to Harry.
  2. I have email metadata from email that John has sent, e.g. converstationId, internetMessageId, messageId (m$ graph user specific).
  3. Now I would like to reply from Harry. Unfortunately the converstionId of Harry is different then John, so I can't use it. What I would like to do is to find email message object in Harry's inbox and use his conversationId.
  4. With valid converstationId, I would be able to call replyAll on Harry behalf.

Can I make call like: GET /me/messages?$filter=internetMessageId eq abcd

Upvotes: 5

Views: 8479

Answers (2)

Tom
Tom

Reputation: 2103

This works

https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq '<[email protected]>'

BUT

One must URL encode the internetMessageId

Thus

https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq '%3C1430948481468.34600%40THCIE7Dev2.onmicrosoft.com%3E'

Upvotes: 2

sasfrog
sasfrog

Reputation: 2460

Yes, you can make a GET call in the form you suggest - have you tried it? The graph API supports standard ODATA query parameters.

On the graph API explorer, the following call works for me:

https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq '<[email protected]>'

Upvotes: 7

Related Questions