1

Doing some work with the Microsoft GraphAPI and the CalendarView. For fun I created an event through Google and invited my Office365 account to ensure the ICalUid between the two were the same.

If I use the EWS service the ICalUid matches the ICalUid when retrieving the event from google. I expected GraphAPI to be the same, however, they do not match.

Google & EWS have something like:

sqvitruh3ho3mrq896tplad4v8@google.com

GraphAPI has:

040000008200E00074C5B7101A82E0080000000038C12994A0A1D1010000000000000000100000002D3AE9C22CC82C42ADE8BFFD6999115D

I've tried several attempts to convert one format to the other, but starting to wonder if they are correlated in any way. Any ideas?

Dan D
  • 2,493
  • 15
  • 23

2 Answers2

5

That is the GOID format as per https://msdn.microsoft.com/en-us/library/ee157690(v=exchg.80).aspx which should be generated by the Exchange depending on who the organizer of the appointment is eg for an a normal norecurring appointment from Gmail you should get and Id like

040000008200E00074C5B7101A82E0080000000000000000000000000000000000000000320000007643616C2D55696401000000716138377132743535326465746637373335303870647263686340676F6F676C652E636F6D00

so

040000008200E00074C5B7101A82E008 = Provider Id

0000000000000000000000000000000000000000 = Data (Y,YH etc)

32000000 = Length (50 Bytes)

7643616C2D55696401000000716138377132743535326465746637373335303870647263686340676F6F676C652E636F6D00 = (HexEncoded) vCal-Uid qa87q2t552detf773508pdrchc@google.com

The Data section depends on the client eg for an appointment created by Local Exchagne user using Outlook it is usually just a Guid, ActiveSync clients (depedning on the OS android/IOS etc) may use a different value. If you use a MapiEditor like OutlookSpy it provides a decoded view of this

Cheers Glen

Glen Scales
  • 20,495
  • 1
  • 20
  • 23
  • Thanks @glen scales, I never would have found that – Dan D May 03 '16 at 13:19
  • How do you calculate the length? As far as I understand, it corresponds to the length of the data field ( 7643616C2D55696401000000716138377132743535326465746637373335303870647263686340676F6F676C652E636F6D00 ) But i can't see how to get the (32000000) from that – Berni May 28 '21 at 08:02
  • The preceding 4 byte's hold the length of the data field its in little-endian byte order so the hex is x32 (or 50 as a decimal). The length is in Bytes so each hex pair ( on hex digit is 1/2 of a byte) so a pair eg 76 43 36 etc represents one byte so 100 characters in hex is 50 bytes. – Glen Scales May 30 '21 at 23:41
1

Microsoft has an invalid iCalUID field. To get the actual iCalUID you need to query the beta endpoint for the field "uid". This bug has been known since early 2020 but they still haven't released the fix to the v1.0 branch. Very frustrating.

Paul Mendoza
  • 5,709
  • 12
  • 53
  • 82