We use EWS to bi-directionally synchronize Exchange events with our application, and we are in the process of migrating to Graph API.
When creating reservations in Exchange through EWS using CreateItem, we set the uid using a self-generated UUID like this (look at the "UID" field) :
<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft. com/exchange/services/2006/types">
<s:Header>
<t:RequestServerVersion Version="Exchange2016"/>
<t:TimeZoneContext>
<t:TimeZoneDefinition Id="Romance Standard Time"/>
</t:TimeZoneContext>
</s: Header>
<s:Body>
<m:CreateItem MessageDisposition="SaveOnly" SendMeetingInvitations="SendToAllAndSaveCopy">
<m:SavedItemFolderId>
<t:DistinguishedFolderId Id="calendar">
<t:Mailbox>
<t: EmailAddress>email@email.com
</t:EmailAddress>
<t:RoutingType>SMTP</t:RoutingType>
<t:MailboxType>Mailbox</t:MailboxType>
</t:Mailbox>
</t:DistinguishedFolderId>
</m:SavedItemFolderId>
<m: Items>
<t:CalendarItem>
<t:Subject>subject</t:Subject>
<t:Sensitivity>Normal</t:Sensitivity>
<t:Body BodyType="HTML"></t:Body>
<t:Importance>Normal</t:Importance>
<t:ReminderIsSet>0
</t: ReminderIsSet>
<t:ReminderMinutesBeforeStart>0</t:ReminderMinutesBeforeStart>
--> <t:UID>81d5f321-af6c-45ae-9cac-ef096ef32069</t:UID>
<t:Start>2022-07-28T17:00:00+02:00</t:Start>
<t: End>2022-07-28T17:30:00+02:00
</t:End>
<t:IsAllDayEvent>0</t:IsAllDayEvent>
<t:LegacyFreeBusyStatus>Busy</t:LegacyFreeBusyStatus>
<t:Location></t:Location>
<t:Resources>
<t:Waitee>
<t:Mailbox>
<t: EmailAddress>resource_email@email.com
</t:EmailAddress>
<t:RoutingType>SMTP</t:RoutingType>
<t:MailboxType>Mailbox</t:MailboxType>
</t:Mailbox>
<t:ResponseType>Accept</t:ResponseType>
</t: Attendee>
</t:Resources>
<t:StartTimeZone Id="Romance Standard Time" Name=""/>
<t:EndTimeZone Id="Romance Standard Time" Name=""/>
</t:CalendarItem>
</m:Items>
</m:CreateItem>
</s:Body>
</s:Envelope>
This identifier seems to be fully supported by Exchange:
- When this event comes back to our application as a result of a "GetItem" SOAP request, it has the same identifier
81d5f321-af6c-45ae-9cac-ef096ef32069 - When I look at the MAPI properties of the event using the OutlookSpy tool, I find our UUID in the "GlobalObjectId" and "CleanGlobalObjectId" fields
However, when we synchronize this same event using Graph API, the ical_uid field is totally different, which generates synchronization problems in our application following the EWS->Graph API migration.
To add some information:
- Using the beta version of Graph API, we get a "uid" field that contains our UUID.
- When the event is created on Outlook, it is a UID generated by EWS and not by our application, there is no such problem
How can I make sure I get the same UID as with EWS and avoid synchronization problems?