I am trying to retrive information about mails within a users mailbox. I am using the following snippet of code:
graphClient.Users[mailbox]
.Messages[messageId]
.Request()
.GetAsync()
.Result;
Which works fine for the most requests.
The messageId is read previously from the graph API.
The app registration has the following permissions.
Found this: using microsoft graph api to read mail behalf of users in the enterprise -> I'm using the application login method.
MessageId's change when an item is moved between folders so it most likely that is the reason your having the problem. To solve it use the immutableid https://learn.microsoft.com/en-us/graph/outlook-immutable-id