Cannot create new folder in Office365 calendar

370 Views Asked by At

When creating a folder in Office365 Outlook Calendar, We are getting the error as 'The Folder Already Exists', but we are not able to find such folder in the Office365 Calendar. We cross-checked for the folder with the same name in outlook web app and the client app but no folder exists with that name. Below are the API and the response.

POST https://graph.microsoft.com/v1.0/me/calendars HTTP/1.1

Request body: {"name":"New calendar"}

"error": {

    "code": "ErrorFolderExists",

    "message": "A folder with the specified name already exists.",

    "innerError": {

        "request-id": "c046eeba-f6f7-4b7e-98a3-b6a9a7055dd2",

        "date": "2018-11-08T14:16:10"

    }

}
1

There are 1 best solutions below

2
On

You can query for the calendar name by using a filter

https://graph.microsoft.com/v1.0/me/calendars?$filter=name eq 'New calendar'

Then delete it using a delete request and the calendars' id

https://graph.microsoft.com/v1.0/me/calendars/<insert calendar_id here>