0

I'm using the Microsoft msgraph api to sync messages from my office365 mailbox to my application. My use case is that I use to keep the metadata for messages in datastore and downloads the messages and attachments on demand.

For some specific messages, it is returning 404 for the given attachment id

https://graph.microsoft.com/v1.0/users/{userId}/messages/AAMkAGIzMzcxNmMxLTJiZmItNDU4Zi05OTNiLWI0NmJkNmZhMzE1NgBGAAAAAAB15cUMraHjRrqmgOydmLQsBwAQMJ4Qu_-gRr5IlUI-VRAzAAAAAAEJAAAQMJ4Qu_-gRr5IlUI-VRAzAAJTlYtDAAA=/attachments/AAMkAGIzMzcxNmMxLTJiZmItNDU4Zi05OTNiLWI0NmJkNmZhMzE1NgBGAAAAAAB15cUMraHjRrqmgOydmLQsBwAQMJ4Qu_-gRr5IlUI-VRAzAAAAAAEJAAAQMJ4Qu_-gRr5IlUI-VRAzAAJTlYtDAAADsnEas9=

{ "error": { "code": "ErrorItemNotFound", "message": "The specified object was not found in the store., The process failed to get the correct properties.", "innerError": { "request-id": "9c0a0aec-ad74-4382-bad9-4dd5dd8d48e7", "date": "2019-06-05T13:06:08" } } }

Further, I checked that without attachment id it's returning all the related attachments but with different Id than the previously stored Id.

https://graph.microsoft.com/v1.0/users/{userId}/messages/AAMkAGIzMzcxNmMxLTJiZmItNDU4Zi05OTNiLWI0NmJkNmZhMzE1NgBGAAAAAAB15cUMraHjRrqmgOydmLQsBwAQMJ4Qu_-gRr5IlUI-VRAzAAAAAAEJAAAQMJ4Qu_-gRr5IlUI-VRAzAAJTlYtDAAA=/attachments

I already know that when someone moves the message from one folder to another folder the message id gets changed but not able to found the use case where only attachment id will change.

ZINDA ROBOT
  • 280
  • 2
  • 15

1 Answers1

0

ATP safe attachments would be one reason that could cause that https://learn.microsoft.com/en-us/office365/securitycompliance/atp-safe-attachments eg a thumbnail attachment is generated temporarily while that attachment is validated. Outside of the immutable Id's https://learn.microsoft.com/en-us/graph/outlook-immutable-id you have no logic guarantee these won't change for any number of reasons.

Glen Scales
  • 20,495
  • 1
  • 20
  • 23