greg-e
greg-e

Reputation: 434

MS Graph Mail The specified object was not found in the store

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. App registration permissions

Found this: using microsoft graph api to read mail behalf of users in the enterprise -> I'm using the application login method.

Upvotes: 2

Views: 3916

Answers (1)

Glen Scales
Glen Scales

Reputation: 22032

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

Upvotes: 8

Related Questions