Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

EWS - ItemId structure documentation?

$
0
0

I've been doing a bit of poking around on ItemIds (and, by extension, the FolderId, not to be confused with Folder EntryId) from the EWS Managed API, and I've found something interesting. The ItemId is pretty obviously base 64 encoded binary. It appears to always be 152 characters long, or 113 bytes if you convert it back into a byte array. The latter part is obviously built on the EntryId, which will include the Folder EntryId. A FolderId from EWS will include the Folder EntryId. The thing is, it's also prepended by 43 bytes of data. I was curious as to what this was, so with a bit of mucking, I found that this is actually some header data plus an ASCII/UTF-8 encoded GUID. This was surprising as GUIDs are usually formatted as 16 bytes, but this is a full XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX formatted GUID as a string, which means it winds up being 36 bytes for data that could have been summed up in 16 bytes.

I'm guessing that this GUID is the MailboxGUID, but I don't currently have Powershell or direct access to an Exchange server to check. It would be pretty nifty if it did turn out to be the MailboxGUID, which didn't seem to be retrievable via EWS in the past, although I suppose it's possible that this was added in 2.0 as I'm using 1.2. I can at least confirm that the GUID only seems to change when connecting to a different mailbox. Can anyone confirm this? It would make sense, but I'm also a bit puzzled as to why they used a 36 byte ASCII/UTF-8 string instead of the usual 16 byte string. I've been unable to find any documentation on the ItemId in EWS (only on the less EWS-specific ones, such as EntryId, SearchId, etc), so I can't really confirm that. Another odd bit is that when using ConvertId, one flag is off on the ParentFolderId in EWS as opposed to the EntryId or other even the ItemId itself (FolderId is flagged 0x0001, PrivateFolder, whereas all others are 0x0007, PrivateMessage), but I guess that does make some sense as EWS seems aware enough of the context.

Is there any further documentation on the structure of the ItemId? The GUID is prepended by the byte length flag (0x0024, 36 bytes in decimal), but there are four more bytes before that. Not sure if that's just an ID/preamble for the ItemId binary stream or what it may signify.




Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>