Forum Discussion
aldenrmd
Oct 10, 2024Copper Contributor
Where to get the correct Message ID for the Graph API Parameter?
Hello, I need help. I am using this API: https://graph.microsoft.com/v1.0/me/messages/{id}/attachments Where I get the message ID is from here: But the response always fails, and I'm...
VasilMichev
Oct 10, 2024MVP
What you are showing on the screenshot above is the "internet message ID", you cannot use that with Graph directly. Graph works with the REST identifier for the message, which you can get from via the LIST method. You can however do as search based on the internet message ID and find any matching messages:
GET https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq '<email address removed for privacy reasons>'
Do note you have to URLencode the value. To learn more about the various identifiers for messages and how to convert between them, read here: https://learn.microsoft.com/en-us/graph/api/user-translateexchangeids?view=graph-rest-1.0&tabs=http
GET https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq '<email address removed for privacy reasons>'
Do note you have to URLencode the value. To learn more about the various identifiers for messages and how to convert between them, read here: https://learn.microsoft.com/en-us/graph/api/user-translateexchangeids?view=graph-rest-1.0&tabs=http