We have a problem deleting Appointments from Exchange using EWS.
I have Full Access for Room, which I'm able to cancel through outlook but not from our application.
Fetching Calendar Items:
Collection appointments = new Collection();
if (service != null)
{
CalendarView calView = new CalendarView(fromDate, toDate);
FindItemsResults<Item> masterResults = service.FindItems(WellKnownFolderName.Calendar, calView);
masterResults.Items.ToList().ForEach(c =>
{
Appointment appointment = c as Appointment;
appointment = Appointment.Bind(service, new ItemId(c.Id.UniqueId));
appointments.Add(appointment);
});
}
We select one appointment from above list and try to cancel that facing exception.
Cancel Appointment Code:
Appointment appointment = Appointment.Bind(service, new ItemId(uniqueId));
var cancelresult = appointment.CancelMeeting("The metting cancelled.");
we get an exception with the message "User must be an organizer for CancelCalendarItem action." This makes me really confused, because when I inspect the deletedAppointment object my email address is set as the organizer.
I have full access for room and able to cancel meeting from Outlook.
Can anyone help on this?