ServiceId.UniqueId Maximum Length and Format
Asked Answered
D

2

8

Every Item (e.g. Task) in Exchange Web Services (EWS) Managed API has an Id property of type ItemId, which then has a String property named UniqueId (inherited from ServiceId — phew, got that?).

I'm planning to keep the value of UniqueId in a database so I need to know what the maximum length of the column should be. Some testing shows that it's at least 152 bytes in length, but that seems like a strange size for a maximum.

A second part to this question is the format of the value. Is this something that can be parsed into a more common type, like a Guid? I'm grasping at straws, I know.

Deherrera answered 2/4, 2013 at 17:55 Comment(0)
C
4

To be safe, we've suggested setting aside 512 characters for the EWS identifier. While I don't expect that it will ever be lengthened to near 512 characters, Microsoft reserves the right to change the format. I highly doubt Exchange will change the format at this point.

Regarding the format of the identifier -- it is intended to be opaque and so it should be neither parsed nor reconstructed.

Chaffin answered 25/3, 2014 at 22:36 Comment(1)
So do you recommend storing it as Varbinary, Varchar, Uniqueidentifier?Theotheobald
W
4

From EWS Identifiers in Exchange:

  • The ItemID element value for folders and items is case-sensitive. If you look at the item ID for a folder or item that is returned by the FindItem operation (or the FindItems EWS Managed API method), you might think that it is a duplicate of another item ID; however, one or more characters in the item IDs for the two items will have a different case.
  • If you are going to store the item ID in a database to retrieve later, we recommend that the field size be 512 bytes, so that it’s large enough to hold the GUID.
  • Don’t assume that your ID will always be valid if you need to retrieve the item at a later time. If an item is moved in the store, the ID can change because of the way a move is handled. An item is actually copied, and a new ID is generated, and then the original item is deleted.
Wallaby answered 14/8, 2015 at 6:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.