I am accessing Exchange Server API through code to create an appointment. I am able to add an appointment in ES but I am facing an issue to fetch existing appointments in order to update or delete those appointments.
My understanding is that providing UniqueId while binding appointment object with the service is standard method to find existing appointments. Unfortunately I can't use UniqueId in my SharePoint application as I have hundreds of existing appointments without UniqueId stored. So it is impossible for me delete any existing appointment using UniqueId. I can fetch new appointments by storing UniqueId as well in the list but I am not sure about existing on.
So I am wondering if it is possible to find an existing appointment in Exchange Server using UID instead of UniqueId?
Here is simplest form of my implementation:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.Credentials = new WebCredentials("test", "test", "acme");
service.Url = new Uri("https://acme.com/EWS/Exchange.asmx");
Appointment appointment = new Appointment(service);
String UID = "D09F3FF6-1461-414C-89E8-C05BC3B66A4B";
appointment.ICalUid = UID;
appointment.Subject = "Test Subject";
appointment.Body = "Test Body";
appointment.Start = new DateTime(2012, 02, 09, 17, 30, 0);
appointment.End = appointment.Start.AddMinutes(30);
appointment.Location = "16th Floor Conference Room";
appointment.RequiredAttendees.Add("tin.tin@acme.com");
appointment.LegacyFreeBusyStatus = LegacyFreeBusyStatus.Busy;
appointment.IsResponseRequested = true;
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
String UniqueId = appointment.Id.UniqueId;
// TODO: instead of using UniqueId, get appointment by ICalUid
appointment = Appointment.Bind(service, new ItemId(UniqueId));
if (appointment != null)
{
//
}
Appreciate your help.