Outlook-addin Modify Reminder value of an appointment - outlook

I'm developing an Outlook add-in, the purpose is to create an appointment with its different properties.
Is that possible to modify the value of the reminder field with the Mailbox API? I can't find a method which do that in the documentation (https://dev.outlook.com/reference/add-ins/).

When something is not available with Office.js api for an Outlook Add-in you can try to use the Exchange Web Services (EWS) to do perform the action
Have a look at this previous answer.
In this answer, I gave code snippets for both (client side or server side approach).

You can use the UpdateItem EWS operation to set flag and reminder fields using the mailbox.makeEwsRequestAsync method:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAMkAGUzNmEzYTBmLTI1NDItNGE0My1iZDk5LWFkMDgxODI3YWNlOQBGAAAAAACK2VEhi72QSaw+u0XV7xUHBwCMotTyA3QkQ7TPAmcrRt4FAAAALwVDAAAuH/1UA8tzTYD5jbYriaIUAAJEgGbPAAA=" />
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI="item:Flag" />
<t:Message>
<t:Flag>
<t:FlagStatus>Flagged</t:FlagStatus>
<t:StartDate>2016-02-24T00:00:00.000Z</t:StartDate>
<t:DueDate>2016-02-24T00:00:00.000Z</t:DueDate>
</t:Flag>
</t:Message>
</t:SetItemField>
<t:SetItemField>
<t:FieldURI FieldURI="item:ReminderDueBy" />
<t:Message>
<t:ReminderDueBy>2016-02-24T15:00:00.000Z</t:ReminderDueBy>
</t:Message>
</t:SetItemField>
<t:SetItemField>
<t:FieldURI FieldURI="item:ReminderIsSet" />
<t:Message>
<t:ReminderIsSet>true</t:ReminderIsSet>
</t:Message>
</t:SetItemField>
<t:SetItemField>
<t:FieldURI FieldURI="item:ReminderMinutesBeforeStart" />
<t:Message>
<t:ReminderMinutesBeforeStart>0</t:ReminderMinutesBeforeStart>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
</soap:Envelope>

As of today (requirement set 1.3) I don't think there is a method in Office.js which allows you to get or set the reminder field of an appointment. Other people have already mentioned that you may try using EWS call to perform the action.

Related

Why is Restriction getting ignored?

I want to get the Id of a folder with the given name in the given parent folder using FindFolder EWS SOAP service through Office JavaScript API function Office.context.mailbox.makeEwsRequestAsync. The specified Restriction seems to get ignored.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
</soap:Header>
<soap:Body>
<m:FindFolder Traversal="Shallow">
<m:FolderShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="folder:DisplayName" />
</t:AdditionalProperties>
</m:FolderShape>
<t:Restriction>
<t:IsEqualTo>
<t:FieldURI FieldURI="folder:DisplayName" />
<t:FieldURIOrConstant>
<t:Constant Value="xyz" />
</t:FieldURIOrConstant>
</t:IsEqualTo>
</t:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="root" />
</m:ParentFolderIds>
</m:FindFolder>
</soap:Body>
</soap:Envelope>
The request is successful, but instead of receiving at most one Folder in the response, I am getting all the folders in the specified parent folder.
I am calling this code from an Outlook Web Add-In which has ReadWriteMailbox permissions.
Please also note that specified restriction in a FindItem SOAP service call also did not work for me while the request was successful.
Can anybody point me in the right direction, please?
Restriction is from Messages not Types so your request is incorrect (not sure why it doesn't throw an error) but if you use
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
</soap:Header>
<soap:Body>
<m:FindFolder Traversal="Shallow">
<m:FolderShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="folder:DisplayName" />
</t:AdditionalProperties>
</m:FolderShape>
<m:Restriction>
<t:IsEqualTo>
<t:FieldURI FieldURI="folder:DisplayName" />
<t:FieldURIOrConstant>
<t:Constant Value="xyz" />
</t:FieldURIOrConstant>
</t:IsEqualTo>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="root" />
</m:ParentFolderIds>
</m:FindFolder>
</soap:Body>
</soap:Envelope>
it should work okay

EWS. FindItem operation. How to map response data to the request?

In my app I need to look for messages with certain custom properties. I'm using FindItem operation. This is the XML of my request:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<typ:RequestServerVersion Version="Exchange2010_SP2" />
</soap:Header>
<soap:Body>
<mes:FindItem Traversal="Shallow">
<mes:ItemShape>
<typ:BaseShape>IdOnly</typ:BaseShape>
</mes:ItemShape>
<mes:Restriction>
<typ:Or>
<typ:IsEqualTo>
<typ:ExtendedFieldURI PropertySetId="36603a56-9a21-4e9d-b4b7-6eb13876716a" PropertyName="OriginalId" PropertyType="String" />
<typ:FieldURIOrConstant>
<typ:Constant Value="F33A7D78-5FCB-492E-AE98-D7E1CBB379C7" />
</typ:FieldURIOrConstant>
</typ:IsEqualTo>
<typ:IsEqualTo>
<typ:ExtendedFieldURI PropertySetId="36603a56-9a21-4e9d-b4b7-6eb13876716a" PropertyName="OriginalId" PropertyType="String" />
<typ:FieldURIOrConstant>
<typ:Constant Value="hello-world-135" />
</typ:FieldURIOrConstant>
</typ:IsEqualTo>
<typ:IsEqualTo>
<typ:ExtendedFieldURI PropertySetId="36603a56-9a21-4e9d-b4b7-6eb13876716a" PropertyName="OriginalId" PropertyType="String" />
<typ:FieldURIOrConstant>
<typ:Constant Value="9BA188D5-EC35-4E46-AA0B-1C902F6EE70E" />
</typ:FieldURIOrConstant>
</typ:IsEqualTo>
</typ:Or>
</mes:Restriction>
<mes:ParentFolderIds>
<typ:DistinguishedFolderId Id="sentitems" />
</mes:ParentFolderIds>
</mes:FindItem>
</soap:Body>
</soap:Envelope>
So I'm looking for three messages as you can see. One of them (second one) doesn't exist. So in the response I expected to receive some indication that no data for this specific message was found. But this is what I get in the response:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="0" MajorBuildNumber="1365" MinorBuildNumber="1" Version="V2_23" />
</s:Header>
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<m:FindItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:FindItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:RootFolder TotalItemsInView="2" IncludesLastItemInRange="true">
<t:Items>
<t:Message>
<t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEJAAAcJDq8WkSCQ77jdOtyazgnAAEJ1zgKAAA=" ChangeKey="CQAAABYAAAAcJDq8WkSCQ77jdOtyazgnAAEJ7PHv" />
</t:Message>
<t:Message>
<t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEJAAAcJDq8WkSCQ77jdOtyazgnAAEJ1zgJAAA=" ChangeKey="CQAAABYAAAAcJDq8WkSCQ77jdOtyazgnAAEJ7PHs" />
</t:Message>
</t:Items>
</m:RootFolder>
</m:FindItemResponseMessage>
</m:ResponseMessages>
</m:FindItemResponse>
</s:Body>
</s:Envelope>
Only two messages and no indication which ones in the request they belong to. So how am I supposed to map the two found messages to the data in request? Are the messages in the response actually 1 and 2? 2 and 3? or 1 and 3 (which is true in this case)? Do you see my confusion? Obviously I'm doing something wrong. There should be a way to map the data easily. How should I build the request the proper way?
UPDATE:
What I also tried was making a separate FindItem node for each message but unfortunately this didn't work either. The response contained data only for the first item
Your ItemShape element caninclude AdditionalProperties element where you can specify your custom properties, such as "OriginalId".

Outlook Web Addin - get SMTP details

Is there a way to get the SMTP details of the current mail from an Outlook web addin? I see that the VSTO addin has this.
I got all the mime data through this
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<GetItem
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<ItemShape>
<t:BaseShape>Default</t:BaseShape>
<t:IncludeMimeContent>true</t:IncludeMimeContent>
</ItemShape>
<ItemIds>
<t:ItemId Id=" item_id "/>
</ItemIds>
</GetItem>
</soap:Body>
</soap:Envelope>
The mime data can then be decoded to get more details about the message

How to query EWS for a Calendar Message Body

I'm looking for a little more details than what was given in this answer: Exchange EWS not returning message body for calendar
Specifically I'm not sure how to get a calendar message's body in a query.
My XML query is:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<m:FindItem Traversal="Shallow" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="item:Body"/>
<t:FieldURI FieldURI="calendar:Start"/>
<t:FieldURI FieldURI="calendar:End"/>
<t:FieldURI FieldURI="calendar:Location"/>
<t:FieldURI FieldURI="item:Attachments"/>
</t:AdditionalProperties>
</m:ItemShape>
<m:CalendarView EndDate="2016-07-08T00:00:00Z" MaxEntriesReturned="999999" StartDate="2016-07-07T00:00:00Z"/>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="calendar"/>
</m:ParentFolderIds>
</m:FindItem>
</s:Body>
</s:Envelope>
But I seem to be getting an error with:
<t:FieldURI FieldURI="item:Body"/>
Error Message
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="1" MajorBuildNumber="534" MinorBuildNumber="21"/>
</s:Header>
<s:Body>
<m:FindItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:FindItemResponseMessage ResponseClass="Error">
<m:MessageText>Property is not valid for this operation.</m:MessageText>
<m:ResponseCode>ErrorInvalidPropertyForOperation</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:MessageXml>
<t:FieldURI FieldURI="item:Body"/>
</m:MessageXml>
</m:FindItemResponseMessage>
</m:ResponseMessages>
</m:FindItemResponse>
</s:Body>
</s:Envelope>
I've looked over the API Here:
https://msdn.microsoft.com/en-us/library/office/aa494315(v=exchg.150).aspx
And I think I must be missing something simple. Is there a way using a specific field based query to get a calendar body?
Thanks
The FindItem operation doesn't return the Body, Attendees and other complex/large properties see https://blogs.msdn.microsoft.com/vikas/2007/07/26/ews-why-does-not-finditem-return-all-the-fields-you-expected/ .
So you need to take the ItemId you get from the FindItem Request and then either make a single GetItem Request https://msdn.microsoft.com/en-us/library/office/aa564509(v=exchg.150).aspx or if you need it for multiple Items batch the GetItem Request together for efficiency.

Exchange web service (EWS) says "Accees denied" when I try to delete calendar event created by me

I am trying to delete a calendar event that I have created a while ago.
Case 1:
I call EWS to create a calendar event using credentials of domain user broom#infusion.com in some room providing email address of the room and then I get ID of the event
Then I delete the event by calling EWS and providing Id and ChangeKey, and all is fine - meeting is deleted
Case 2
I create event the same way like in Case 1
I get list of calendar events for this room. Now ID of the event has HexEntryId format. So I use ConvertId method to convert it to EwsLegacyId required by DeleteItem method
I call DeleteItem method with ID of event provided by ConvertId method, but without ChangeKey (I don't have it)
DeleteItemResponse says "Access is denied. Check credentials and try again."
Why can I remove event in Case 1 and I cannot in Case 2? What should I do to delete the event (like in Case 2)?
Here are details of request and responses:
Case 1:
I call EWS to create a calendar event using credentials of domain user broom#mycompany.com in some room by providing email address of the room – a meeting like this:
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<soap:Body>
<CreateItem xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\" SendMeetingInvitations=\"SendToAllAndSaveCopy\" >
<SavedItemFolderId>
<t:DistinguishedFolderId Id=\"calendar\"/>
</SavedItemFolderId>
<Items>
<t:CalendarItem xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<Subject>Instant Meeting</Subject>
<Body BodyType=\"Text\">Generated By mycompany Room Booker</Body>
<ReminderIsSet>false</ReminderIsSet>
<ReminderMinutesBeforeStart>60</ReminderMinutesBeforeStart>
<Start>2015-10-01T10:26:02.000Z</Start>
<End>2015-10-01T10:41:02.000Z</End>
<IsAllDayEvent>false</IsAllDayEvent>
<LegacyFreeBusyStatus>Busy</LegacyFreeBusyStatus>
<RequiredAttendees>
<Attendee>
<Mailbox>
<EmailAddress>brdmlt-mainbrd#mycompany.com</EmailAddress>
</Mailbox>
</Attendee>
</RequiredAttendees>
</t:CalendarItem>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>
then meeting is accepted and I get ItemID like:
state.ChangeKey: "DwAAABYAAADw3LMNr7pMRqtEFFAbr0MeAAAAhxz0"
state.Id: "AAASAGJyb29tQGluZnVzaW9uLmNvbQBGAAAAAAB5mlhabHe9S4yVHCob9IbcBwDw3LMNr7pMRqtEFFAbr0MeAAAAOdnlAADw3LMNr7pMRqtEFFAbr0MeAAAAhrdWAAA="
Then I delete the event by calling EWS and providing Id and ChangeKey:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
<soap:Header/>
<soap:Body>
<m:DeleteItem DeleteType=\"MoveToDeletedItems\" SendMeetingCancellations=\"SendToAllAndSaveCopy\">
<m:ItemIds>
<t:ItemId Id=\"AAASAGJyb29tQGluZnVzaW9uLmNvbQBGAAAAAAB5mlhabHe9S4yVHCob9IbcBwDw3LMNr7pMRqtEFFAbr0MeAAAAOdnlAADw3LMNr7pMRqtEFFAbr0MeAAAAhrdWAAA=\" ChangeKey=\"DwAAABYAAADw3LMNr7pMRqtEFFAbr0MeAAAAhxz0\"/>
</m:ItemIds>
</m:DeleteItem>
</soap:Body>
</soap:Envelope>
and all is fine. The event is deleted.
Case 2:
But when I create event the same way and get response like this:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="235" MinorBuildNumber="1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:CreateItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:CalendarItem>
<t:ItemId Id="AAASAGJyb29tQGluZnVzaW9uLmNvbQBGAAAAAAB5mlhabHe9S4yVHCob9IbcBwDw3LMNr7pMRqtEFFAbr0MeAAAAOdnlAADw3LMNr7pMRqtEFFAbr0MeAAAAhrdYAAA=" ChangeKey="DwAAABYAAADw3LMNr7pMRqtEFFAbr0MeAAAAhx08" />
</t:CalendarItem>
</m:Items>
</m:CreateItemResponseMessage>
</m:ResponseMessages>
</m:CreateItemResponse>
</s:Body>
</s:Envelope>
and when I list calendar events for this room like below:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP2" />
</soap:Header>
<soap:Body>
<GetUserAvailabilityRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Bias>300</Bias>
<StandardTime>
<Bias>0</Bias>
<Time>02:0:00</Time>
<DayOrder>1</DayOrder>
<Month>10</Month>
<DayOfWeek>Sunday</DayOfWeek>
</StandardTime>
<DaylightTime>
<Bias>-60</Bias>
<Time>02:00:00</Time>
<DayOrder>2</DayOrder>
<Month>3</Month>
<DayOfWeek>Sunday</DayOfWeek>
</DaylightTime>
</TimeZone>
<MailboxDataArray>
<MailboxData xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Email>
<Name/>
<Address>BRDHOU-MAINBRD#mycompany.com</Address>
<RoutingType>SMTP</RoutingType>
</Email>
<AttendeeType>Room</AttendeeType>
<ExcludeConflicts>false</ExcludeConflicts>
</MailboxData>
</MailboxDataArray>
<FreeBusyViewOptions xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<TimeWindow>
<StartTime>2015-10-01T06:34:09</StartTime>
<EndTime>2015-10-01T23:59:59</EndTime>
</TimeWindow>
<MergedFreeBusyIntervalInMinutes>60</MergedFreeBusyIntervalInMinutes>
<RequestedView>Detailed</RequestedView>
</FreeBusyViewOptions>
</GetUserAvailabilityRequest>
</soap:Body>
</soap:Envelope>
I get response with IDs in some other format (HexEntryId):
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="235" MinorBuildNumber="1" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetUserAvailabilityResponse xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<FreeBusyResponseArray>
<FreeBusyResponse>
<ResponseMessage ResponseClass="Success">
<ResponseCode>NoError</ResponseCode>
</ResponseMessage>
<FreeBusyView>
<FreeBusyViewType xmlns="http://schemas.microsoft.com/exchange/services/2006/types">Detailed</FreeBusyViewType>
<CalendarEventArray xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<CalendarEvent>
<StartTime>2015-10-01T06:36:51</StartTime>
<EndTime>2015-10-01T06:51:51</EndTime>
<BusyType>Busy</BusyType>
<CalendarEventDetails>
<ID>00000000B23AEBAC6379B34DBBBA0B525D2BBFD70700C26EC63E0E9E2A49B110258061BF491D000000FDECCA0000C26EC63E0E9E2A49B110258061BF491D0000D9385B8C0000</ID>
<Subject>Boardroom Tablet </Subject>
<IsMeeting>true</IsMeeting>
<IsRecurring>false</IsRecurring>
<IsException>false</IsException>
<IsReminderSet>false</IsReminderSet>
<IsPrivate>false</IsPrivate>
</CalendarEventDetails>
</CalendarEvent>
</CalendarEventArray>
<WorkingHours xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<TimeZone>
<Bias>300</Bias>
<StandardTime>
<Bias>0</Bias>
<Time>02:00:00</Time>
<DayOrder>1</DayOrder>
<Month>11</Month>
<DayOfWeek>Sunday</DayOfWeek>
</StandardTime>
<DaylightTime>
<Bias>-60</Bias>
<Time>02:00:00</Time>
<DayOrder>2</DayOrder>
<Month>3</Month>
<DayOfWeek>Sunday</DayOfWeek>
</DaylightTime>
</TimeZone>
<WorkingPeriodArray>
<WorkingPeriod>
<DayOfWeek>Monday Tuesday Wednesday Thursday Friday</DayOfWeek>
<StartTimeInMinutes>480</StartTimeInMinutes>
<EndTimeInMinutes>1140</EndTimeInMinutes>
</WorkingPeriod>
</WorkingPeriodArray>
</WorkingHours>
</FreeBusyView>
</FreeBusyResponse>
</FreeBusyResponseArray>
</GetUserAvailabilityResponse>
</s:Body>
</s:Envelope>
To be able to call DeleteItem I need this Id in EwsLegacyId format instead of HexEntryId format, so I call ConvertId method:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010" />
</soap:Header>
<soap:Body>
<m:ConvertId DestinationFormat="EwsLegacyId">
<m:SourceIds>
<t:AlternateId Format="HexEntryId" Id="00000000B23AEBAC6379B34DBBBA0B525D2BBFD70700C26EC63E0E9E2A49B110258061BF491D000000FDECCA0000C26EC63E0E9E2A49B110258061BF491D0000D9385B940000" Mailbox="BRDNYC-Collab2#mycompany.com" />
</m:SourceIds>
</m:ConvertId>
</soap:Body>
</soap:Envelope>
and I get
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="235" MinorBuildNumber="1" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:ConvertIdResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:ConvertIdResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:AlternateId xsi:type="t:AlternateIdType" Format="EwsLegacyId" Id="AAAbAEJSRE5ZQy1Db2xsYWIyQGluZnVzaW9uLmNvbQBGAAAAAACyOuusY3mzTbu6C1JdK7/XBwDCbsY+Dp4qSbEQJYBhv0kdAAAA/ezKAADCbsY+Dp4qSbEQJYBhv0kdAADZOFuUAAA=" Mailbox="BRDNYC-Collab2#mycompany.com" />
</m:ConvertIdResponseMessage>
</m:ResponseMessages>
</m:ConvertIdResponse>
</s:Body>
</s:Envelope>
And when I try to call DeleteItem on this Id like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<m:DeleteItem DeleteType="MoveToDeletedItems" SendMeetingCancellations="SendToAllAndSaveCopy">
<m:ItemIds>
<t:ItemId Id="AAAbAEJSRE5ZQy1Db2xsYWIyQGluZnVzaW9uLmNvbQBGAAAAAACyOuusY3mzTbu6C1JdK7/XBwDCbsY+Dp4qSbEQJYBhv0kdAAAA/ezKAADCbsY+Dp4qSbEQJYBhv0kdAADZOFuUAAA=" />
</m:ItemIds>
</m:DeleteItem>
</soap:Body>
</soap:Envelope>
I get
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="235" MinorBuildNumber="1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</s:Header>
<s:Body>
<m:DeleteItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:DeleteItemResponseMessage ResponseClass="Error">
<m:MessageText>Access is denied. Check credentials and try again.</m:MessageText>
<m:ResponseCode>ErrorAccessDenied</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
</m:DeleteItemResponseMessage>
</m:ResponseMessages>
</m:DeleteItemResponse>
</s:Body>
</s:Envelope>
"Accees denied. Check credentials and try again"
In Case 1 your deleting the Appointment from your calendar which you have Full Access to. In Case2 it looks like your trying to delete the appointment from the Room Mailbox which you may or may not have Full rights to (the default is read only even if you are the organizer of the appointment its the calendar itself you would need rights to). In the case where you where the organizer of said appointment you would be better to just cancel the appointment in your calendar and send the cancellation through to the Room mailbox and let the auto-accept on the Room mailbox process and perform the delete that way or you would need to assign the mailbox that is trying to do the Delete Full access to the Room mailbox in question.
cheers
Glen

Resources