Microsoft Graph API - find message by internetmessageid
Asked Answered
L

2

5

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

Luminal answered 14/6, 2017 at 23:40 Comment(0)
F
2

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'
Flor answered 11/9, 2020 at 8:40 Comment(0)
A
7

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]>'

Aerification answered 15/6, 2017 at 0:48 Comment(3)
Worked for me, but had to remove the < >Repulsion
I tried the same thing, but it didn't work for me. Is anyone else able to do this ?Augustin
@SwastiGupta if you're still stuck, maybe ask a new question and provide some details about what you're trying and what the error/behaviour is that you're seeing.Aerification
F
2

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'
Flor answered 11/9, 2020 at 8:40 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.