1

The 'Create calendar in calendar group' Outlook API endpoint has stopped working recently (within the past couple of weeks) in a multi-tenant application that I am currently working on.

Here is a reproduction of the problem using the Python shell:

import api

>>> url = "https://outlook.office.com/api/v2.0/users/auser@adomain.com/calendargroups"
>>> response = api.get(url)
>>> response
[{
    u'ClassId': u'bf22395d-e505-4f58-8504-6e6e8ef8c3c7', 
    u'Name': u'My Calendar Group', 
    u'ChangeKey': u'g4QAQQ9PZUGX1I2OsM9/LgAAA0km+g==', 
    u'@odata.id': u"https://outlook.office.com/api/v2.0/Users('46560569-3535-441e-9bcf-eb093a992360@767316c0-7a9b-4a7c-95e9-5490466be3f0')/CalendarGroups('AAMkAGVmNzJkNGNiLWE4YmYtNDQ2NC1iOGJiLWI5ZmFlYzgyNzVmYgBGAAAAAAC3biJFdLv_S7D_aGLbIKWwBwCDhABBD09lQZfUjU6wz38uAAAAAAEGAACDhABBD09lQZfUjU6wz38uAAADSL12AAA=')", 
    u'Id': u'AAMkAGVmNzJkNGNiLWE4YmYtNDQ2NC1iOGJiLWI5ZmFlYzgyNzVmYgBGAAAAAAC3biJFdLv_S7D_aGLbIKWwBwCDhABBD09lQZfUjU6wz38uAAAAAAEGAACDhABBD09lQZfUjU6wz38uAAADSL12AAA='
}]


>>> calendargroup_id = response[0]['Id']
>>> url += "/%s/calendars" % calendargroup_id
>>> url
"https://outlook.office.com/api/v2.0/users/auser@adomain.com/calendargroups/AAMkAGVmNzJkNGNiLWE4YmYtNDQ2NC1iOGJiLWI5ZmFlYzgyNzVmYgBGAAAAAAC3biJFdLv_S7D_aGLbIKWwBwCDhABBD09lQZfUjU6wz38uAAAAAAEGAACDhABBD09lQZfUjU6wz38uAAADSL12AAA=/calendars"

>>> api.get(url) // This API call succeeds. It successfully tells us that this calendargroup contains no calendars. In other words it is able to identify the calendargroup using the calendargroup_id we send it.
[]

>>> api.post(url, data={'Name': 'New Calendar'}) // This is the failing API call. If we try to do a POST request in order to create a new calendar, the API can no longer parse our id, and complains:
{u'error': {u'message': u'Id is malformed.', u'code': u'ErrorInvalidIdMalformed'}}

I have confirmed that this error happens on both the Microsoft Graph and Outlook API endpoints.

I think it may be related to the type of base64 decoding that is being done on the API endpoint, because I was able to get the API to work by replacing all instances of '_' with '+' in one of the ids. This workaround does not work if the id contains a '-' character, in which case I have found no way around the error.

We are using many other endpoints to create events, calendar groups, and subscriptions, and they are all working correctly. It is only this endpoint which is giving us problems.

Any ideas on how to get around this error?

0 Answers0