Office 365 default Calendar's ID changes automatically

1.2k views Asked by At

I was using V2 DLL of Office 365 API for performing calendar operations. I am saving default calendar's ID for performing operations on it.

It was working fine for me from last two years but lately since last 1 month, when I am trying to fetch calendars from my account - just to check if the calendar is available on whom I am trying to work on - the calendar ID fetched is different from the calendar ID fetched from O365 API

Saved Calendar ID - AQMkADc5NDI0NjFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX8jvkC_BGp2m1nqTgcABqRbG9B8nEivpWgOOBcJGwAAAgEGAAAABqRbG9B8nEivpWgOOBcJGwABH-QZPwAAAA==

New Response -

[{
    "IsBooking": false,
    "IsAdditional": false,
    "CalendarName": "Calendar",
    "CalendarId": "AQMkADc5NDI0NjFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX8jvkC_BGp2m1nqTgcABqRbG9B8nEivpWgOOBcJGwAAAgEGAAAABqRbG9B8nEivpWgOOBcJGwABHKkz6wAAAA==",
    "Selected": false,
    "IsDefault": true,
    "HasWriteAccess": true,
    "IsFreeBusy": true,
    "EWS_URL": null,
    "CalendarColour": "#5D61DF",
    "TimeZoneId": null
}]

However the change is not permanent and after a day or so, when tried again, the calendar id changes back to same id saved in db as default calendar id.

The ID of calendar is calendar's unique identifier. However in many cases, it's value is changed. Is there any way by which we can identify the same calendar using changeKey? Any idea how we can use changeKey property? https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar#CalendarResource

I find it strange too but only last 30-35 characters changed for calendar id. May be something wrong with encryption algorithm. Please suggest.

1

There are 1 answers

2
David Sterling - MSFT On

I am circling back with the team on this one. The Id of a folder should never change. It is based on the PR_ENTRYID of the folder in store which is immutable within a mailbox. I am not sure what extra goodness they stuff in the id in REST - it does appear there is some concatenation going on.

As for change key, it isn't related directly to the id, so there really isn't a way to convert from the change key to the id. This appears to simply be a bug on our side. But of course, the change key changes whenever there is a change to the folder and is an opaque blob (even to us at the OData and EWS layer).

Of interest, you could also request the PR_ENTRYID extended property with your fetches and you should see that the underlying id is always the same. But that wouldn't fix anything other than to future your understanding of what is going on under the covers.

I will post back when I get a response from them.