Mark
Mark

Reputation: 51

Office365 Calendar REST API -- cannot delete calendars

I'm working on a project where I add and update sports calendars to a user's Outlook calendar.

I'm facing a consistent issue where I can't delete ANY calendars via the API or the desktop web application.

Every time I delete a calendar through the API, I receive the following code and message:

{ 
  code: 'ErrorFolderExists',
  message: 'A folder with the specified name already exists.' 
}

Any ideas?

My API call is something like:

DELETE https://outlook.office.com/api/v2.0/me/calendars/:calendarId

The only solution I've seen is to rename the calendar and then delete it, but I'm hoping for something a little more stable.

Any help would be appreciated!

Upvotes: 1

Views: 488

Answers (1)

AidaNow
AidaNow

Reputation: 598

This error happens because you have deleted a calendar with the same name before; if you check your "Deleted Items" folder, you will see your previously deleted calendar. There are three ways around it:

  1. Delete the previously deleted calendar from your "Deleted Items" folder; please note that you will not be able to recover the calendar after permanently deleting it.
  2. Rename your previously deleted calendar
  3. Rename the current calendar you want to delete

Upvotes: 3

Related Questions