Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Office 365 Rest API - Changing message Id

Is there any scenario in which the Id field on a message could change?

We received a message at today (Thu, 19 Feb 2015 10:29:48 GMT +00:00) with an ID ending in 'MT80AAA='. However when trying to retrieve message details at a later time I get a 404 error with the message:

{ "error" : { "code": "ErrorItemNotFound", "message" : "The specified object was not found in the store." } }

When I do another request to get all messages from that inbox the same message appears however it has another ID ending in 'TwDlAAA='.

Both the message ID and the Attachment ID have been changed at some point from the first time receiving the message and now.

Is this a common occurrence? What could cause this? Or is it a bug?

like image 525
Nick Maher Avatar asked Jan 18 '26 05:01

Nick Maher


1 Answers

It's not a bug, it's definitely a common occurrence with Exchange. Entry ID's aren't static, and can change in a number of scenarios. Common ones are moving the item (which is essentially a copy and delete operation, copy gets a new ID since it's a new item), or mailbox move (which may be applicable to your case).

Typically I would advise a strategy of optimistically storing the ID and using it first, since it will usually work. Then I'd recommend storing the record key and search key as a backup, so you could try searching for the item in the event the Id no longer works. However, the REST API doesn't expose these fields! So you'd have to make do with searching for the item based on whatever fields are important to you, which isn't ideal. I'll provide this feedback to our developers.

like image 100
Jason Johnston Avatar answered Jan 21 '26 09:01

Jason Johnston



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!