noexpert
noexpert

Reputation: 33

Graph API calendarid is not unique and changing

I have noticed that the calendar id is not a unique value and it changes for reasons unknown.

I have stored some calendar id values in a database. At a later point when tried to insert events using those values, the id stored in database no longer matches the Calendar id in Microsoft Graph. Upon investigation the calendar id has been changed in the last few characters.

Can someone explain this anomaly please? any workarounds
Regards

Upvotes: 1

Views: 1043

Answers (1)

Marc LaFleur
Marc LaFleur

Reputation: 33094

For an event, the id property is a composite value based on a number of other properties. If something changes (such as the path to the item), the id value will change. So while it is unique to a mailbox, it is not suitable for a permanent reference to the event.

With an event, you should use the iCalUid property. This is a unique value that is permanently persisted across all calendars. So even if the event is a meeting with multiple attendees, each attendee will persist the same iCalUid even if an attendee isn't part of your organization, or even on Exchange).

For the Calendar itself, I wouldn't expect the id to change unexpectedly (i.e. the user didn't delete and recreate or edit the calendar itself in some way).

Upvotes: 2

Related Questions