I am creating a recurring appointment via EWS managed API.
Creating Weekly appointments works.
Creating Monthly Appointments doesn't work.
When EWS posts my monthly appointment to the server, Exchange does not return any error, yet the appointment is not there.
All I can see, it should be there - but it isn't!
Does anyone here know why?
Here is the trace of the recurrence posted to the server:
<t:Recurrence>
<t:RelativeMonthlyRecurrence>
<t:Interval>1</t:Interval>
<t:DaysOfWeek>Saturday</t:DaysOfWeek>
<t:DayOfWeekIndex>Last</t:DayOfWeekIndex>
</t:RelativeMonthlyRecurrence>
<t:NumberedRecurrence> <br /> <t:StartDate>2014-04-26</t:StartDate>
<t:NumberOfOccurrences>10</t:NumberOfOccurrences>;
</t:NumberedRecurrence>
</t:Recurrence>
and here is the trace of the response header
<Trace Tag="EwsResponseHttpHeaders" Tid="18" Time="2014-04-25 14:00:56Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
X-EwsPerformanceData: RpcC=13;RpcL=919;LdapC=0;LdapL=0;
Persistent-Auth: true
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Fri, 25 Apr 2014 14:00:56 GMT
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
</Trace>
and the response body.
<Trace Tag="EwsResponse" Tid="18" Time="2014-04-25 14:00:56Z" Version="15.00.0516.014"> <br /> <?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14" MinorVersion="0" MajorBuildNumber="722" MinorBuildNumber="0" Version="Exchange2010" 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"> r /> <m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:CalendarItem>
<t:ItemId Id="AAMkADZmMGNlYzkwLWE0NGUtNGQxMC04MTc4LTE3MWM3MzExM2UzMQBGAAAAAAAVFLM1uwjxTpI7ZWapZLFDBwAG/DdYA3s2SJJPro446HsmAAAAAAAgAAAG/DdYA3s2SJJPro446HsmAAAOswdMAAA=" ChangeKey="DwAAABYAAAAG/DdYA3s2SJJPro446HsmAAAOsyvo" />
</t:CalendarItem>
</m:Items>
</m:CreateItemResponseMessage>
</m:ResponseMessages> r /> </m:CreateItemResponse>
</s:Body>
</s:Envelope>
</Trace>
Given that your XML is invalid, no surprise:
<t:DaysOfWeek>Saturday</t:DaysOfWeek>
^^^^---- should be just <
<t:DayOfWeekIndex>Last</t:DayOfWeekIndex>
^^^^----ditto
<t:NumberedRecurrence> <br /> <t:StartDate>2014-04-26</t:StartDate>
^^^^^^---huh? ^^^^----ditto
Related
Looks like there is hardly any activity on EWS here but maybe...
I am in the process of supporting Oauth in my EWS app but i'm stuck on getting events from a pullsubscription.
There's no issue for mailbox folders, only public folders.
The only change in the code is that the exchange service now has Oauthcredentials and impersonates an email address that has owner permissions on the public folder .
When using basic authentication the exchange service credentials are that of a "service account" email address and it does not use impersonation to get a pullsubscribtion on the public folder.
I'm not getting errors when setting the pullsubscription, and I can check that it has an ID, so it is there. However when I issue the getevents method (after adding some items to the folder) nothing fires.
this is the trace of the getevents (i made sure there were events in the folder)
26-8-2022 17:56:31 : EwsRequestHttpHeaders --- <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2022-08-26 15:56:31Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent:
ExchangeServicesClient/15.00.0913.015
Accept-Encoding: gzip,deflate
X-AnchorMailbox: publicfolderstore_bac380fe#domainname.onmicrosoft.com
X-PublicFolderMailbox: publicfolderstore_bac380fe#domainname.onmicrosoft.com
X-PreferServerAffinity: True
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6IkRPRTZVMFJHdnM0X3FHanBhbU9KTjM1VHVsdmNRWUtjNHlFVDk2YnhfQjgiLCJhbGciOiJSUzI1NiIsIng1dCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSIsImtpZCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSJ9.eyJhdWQiOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2VkMDc0NDQxLWI4MjUtNDJjYy04ODU2LTE3YWUzYjBiMmY0Mi8iLCJpYXQiOjE2NjE1Mjg5NjcsIm5iZiI6MTY2MTUyODk2NywiZXhwIjoxNjYxNTMyODY3LCJhaW8iOiJFMlpnWUxpVHNzZktUS2x6bGtGdzNoS3Z5WmIyQUE9PSIsImFwcF9kaXNwbGF5bmFtZSI6IkV4Y2hhbmdlR3JvdXBDYWxlbmRhciIsImFwcGlkIjoiZmRlYTFhZmYtZmVhYS00ZDA0LWI3OTUtNTVkODczZjIyODNiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvZWQwNzQ0NDEtYjgyNS00MmNjLTg4NTYtMTdhZTNiMGIyZjQyLyIsIm9pZCI6IjM4MDkxNzg0LWU5NzItNDk4ZS05ZTlkLTZmMGE2NzQ4MTMyZSIsInJoIjoiMC5BVThBUVVRSDdTVzR6RUtJVmhldU93c3ZRZ0lBQUFBQUFQRVB6Z0FBQUFBQUFBQlBBQUEuIiwicm9sZXMiOlsiZnVsbF9hY2Nlc3NfYXNfYXBwIl0sInNpZCI6IjYwN2UxMDI4LTUwOTAtNDRjMS04NDc1LTFiNDFmZjQ0NGI4OSIsInN1YiI6IjM4MDkxNzg0LWU5NzItNDk4ZS05ZTlkLTZmMGE2NzQ4MTMyZSIsInRpZCI6ImVkMDc0NDQxLWI4MjUtNDJjYy04ODU2LTE3YWUzYjBiMmY0MiIsInV0aSI6Ik5oY3hiMHIxeUVpbGlIR2hWRFU0QUEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdfQ.GeDfpt7ABAp5WpL9su265dV9UvilX6lxt5eCj7FWrBqGLhSNOL6fRfGGH-98nOKbqONmpEiXe0M61cOagKnrlNoyNgnvsC6bE1v6Nt_Uk44MPHfAs4MW1GDn9RtGbL9EEIDTZFg4qwrfRToOkyliFIcsfpXnXKmBiVSN0XFXtyHdvJpCjrb7Jj4o-qzGKKF1BREAVHrpIHBMz1r8u3UVihMQBEnI8X-a_qOF7MmgeyKBCLabZ5oFXOVsVPCI9re89W0q9jx04d0gnBLSAsjSHh94aG0P7ffpjupu3GSpZAm6Y9AkWv629EDO_C1wOshdI8--F9yyqhJ44Oh90Ha9xw
</Trace>
26-8-2022 17:56:31 : EwsRequest --- <Trace Tag="EwsRequest" Tid="1" Time="2022-08-26 15:56:31Z" Version="15.00.0913.015">
<?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="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>account#domainname.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetEvents>
<m:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAS114Ai9w+UayiTSZLtc6DY6SxEJ7h9oIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</m:SubscriptionId>
<m:Watermark>AQAAABTg+YC4KZFNttW01ElEHaecAgsrAAAAAAA=</m:Watermark>
</m:GetEvents>
</soap:Body>
</soap:Envelope>
</Trace>
26-8-2022 17:56:31 : EwsResponseHttpHeaders --- <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2022-08-26 15:56:31Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
request-id: de8811fe-8069-c2ff-15a7-5ac62e39d3f5
Alt-Svc: h3=":443",h3-29=":443"
X-CalculatedFETarget: AM6PR01CU002.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
X-RUM-Validated: 1
x-ms-appId: fdea1aff-feaa-4d04-b795-55d873f2283b
Restrict-Access-Confirm: 1
x-EwsHandler: GetEvents
X-BeSku: WCS6
X-DiagInfo: AS8PR07MB7925
X-BEServer: AS8PR07MB7925
X-Proxy-RoutingCorrectness: 1
X-Proxy-BackendServerStatus: 200
X-FEProxyInfo: AM0PR02CA0136.EURPRD02.PROD.OUTLOOK.COM
X-FEEFZInfo: AMS
X-FEServer: AM6PR01CA0042,AM0PR02CA0136
X-FirstHopCafeEFZ: AMS
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Fri, 26 Aug 2022 15:56:28 GMT
Set-Cookie: exchangecookie=52d38d4eb5c14276b165655c6cd18691; path=/; secure
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
</Trace>
26-8-2022 17:56:31 : EwsResponse --- <Trace Tag="EwsResponse" Tid="1" Time="2022-08-26 15:56:31Z" Version="15.00.0913.015">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="5588" MinorBuildNumber="3" Version="V2018_01_08" 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" />
</s:Header>
<s:Body>
<m:GetEventsResponse 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:GetEventsResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Notification>
<t:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAS114Ai9w+UayiTSZLtc6DY6SxEJ7h9oIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</t:SubscriptionId>
<t:PreviousWatermark>AQAAABTg+YC4KZFNttW01ElEHaecAgsrAAAAAAA=</t:PreviousWatermark>
<t:MoreEvents>false</t:MoreEvents>
<t:StatusEvent>
<t:Watermark>AQAAABTg+YC4KZFNttW01ElEHaf4BQsrAAAAAAE=</t:Watermark>
</t:StatusEvent>
</m:Notification>
</m:GetEventsResponseMessage>
</m:ResponseMessages>
</m:GetEventsResponse>
</s:Body>
</s:Envelope>
</Trace>
What could be the issue? Any suggestions are much appreciated!
Are there more the one Public Mailbox Folder doing the hosting, from what you describing it sounds like you create the subscription on the mailbox/cas that is hosting the hierarchy but the content is hosted on another public folder mailbox. A few thing to be aware of are
With Push and Pull notification they are hosted on a particular CAS server https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/getevents-operation
The SubscriptionID of the request is confirmed to be a valid subscription that is hosted on the Client Access server. If it is not, the GetEvents call fails.
So the first thing that might be happening is that routing of the request if failing. One thing you might want to do is compare the headers
X-CalculatedFETarget: AM6PR01CU002.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget:
From when you using Basic and it working to when you using the oAuth
The SMTP address of the authenticated user for the request is compared to the SMTP address of the user who created the subscription. If they do not match, the GetEvents request fails.
This is the other reason I could see it failing when using the client credentials flow. Impersonation from a Service Principal vs a User Principal maybe happening different on the back-end (could be bug). Probably the way to confirm that is test it using a Delegate that has a Mailbox and EWS Impersonation rights and use ROPC (or ever auth code flow) and see if the same thing happens.
These later thing should give different errors however.
Thanks for your help Glen.
I have one public folder mailbox with one public folder in it. (It's on office365 ofcourse.)
I am including the full trace of subscription and response at the bottom.
The subscription ID is the same in both the subscription as the getevents.
I am not getting an error that the subscription was not found. So I would think that the problem is not routing?
The headers are these for resp subscribing and polling:
CalculatedFETarget: AM6P193CU004.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
CalculatedFETarget: AS8PR04CU007.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
The CalculatedFETarget is different. Is this the hiarchy? Do you think this could be an issue?
This "Probably the way to confirm that is test it using a Delegate that has a Mailbox and EWS Impersonation rights and use ROPC (or ever auth code flow) and see if the same thing happens." is over my head.
In the current code, the account that is impersonated by the oAuth authenticated ExchangeService has application impersonation permissions and is listed as owner of the public folder.
I would like to emphasize that everything works fine for mailbox folders. In that case the owner/email address of the mailbox is impersonated by the oAuth authenticated ExchangeService.
"Impersonation from a Service Principal vs a User Principal maybe happening different on the back-end (could be bug)."
It could indeed be a bug. Do you know how a single person like me can still get access to Microsoft for this. One used to be able to raise a (paid) incident but now you need a prem. support contract to reach them.
========== subscription ==========
1-9-2022 12:57:13 : EwsRequestHttpHeaders --- <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2022-09-01 10:57:13Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0913.015
Accept-Encoding: gzip,deflate
X-AnchorMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PublicFolderMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PreferServerAffinity: true
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6InA5eWx3dnE4RW9zQzJMdjNCeklmYzZxTlh1bjVmQzl3QXAyWENGbG1QOVkiLCJhbGciOiJSUzI1NiIsIng1dCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSIsImtpZCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSJ9.eyJhdWQiOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2VkMDc0NDQxLWI4MjUtNDJjYy04ODU2LTE3YWUzYjBiMmY0Mi8iLCJpYXQiOjE2NjIwMjk1MjgsIm5iZiI6MTY2MjAyOTUyOCwiZXhwIjoxNjYyMDMzNDI4LCJhaW8iOiJFMlpnWUhob1p6K3ZvcFh0VnZWZklhK1ZvVEtWQUE9PSIsImFwcF9kaXNwbGF5bmFtZSI6IkV4Y2hhbmdlR3JvdXBDYWxlbmRhciIsImFwcGlkIjoiZmRlYTFhZmYtZmVhYS00ZDA0LWI3OTUtNTVkODczZjIyODNiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvZWQwNzQ0NDEtYjgyNS00MmNjLTg4NTYtMTdhZTNiMGIyZjQyLyIsIm9pZCI6IjM4MDkxNzg0LWU5NzItNDk4ZS05ZTlkLTZmMGE2NzQ4MTMyZSIsInJoIjoiMC5BVThBUVVRSDdTVzR6RUtJVmhldU93c3ZRZ0lBQUFBQUFQRVB6Z0FBQUFBQUFBQlBBQUEuIiwicm9sZXMiOlsiZnVsbF9hY2Nlc3NfYXNfYXBwIl0sInNpZCI6IjE1MzQ5NThhLThmYjYtNDg4Ny05ZWU0LWFkZDM2ZGQ4ZDVlYyIsInN1YiI6IjM4MDkxNzg0LWU5NzItNDk4ZS05ZTlkLTZmMGE2NzQ4MTMyZSIsInRpZCI6ImVkMDc0NDQxLWI4MjUtNDJjYy04ODU2LTE3YWUzYjBiMmY0MiIsInV0aSI6InZtR2ZDS0ZSWTBPS2R2OTVaU0Z1QUEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdfQ.IlPfIOgl6H7Kenn999w6GPrHjPKyT_T_JLxSQc2w1Pjs8W_W4_brehe_wVX8YdqQPLEOo4fYX9l3gHHZeXtuOkgir1hM9w6TomM_FP6vBTeuGjVe7xLL0fSPvAd63pwvQicCj7SbX-RQBpvKeAapf5zA70UOYfo_NKic_ErJSWoYkSvDDX67LipjQrZ68X8XQQe3z_U7PfbwKABY91twQftzI4WXbQoRcEv8AgCQ9dxhFTIJgdzeV6slf-vnPHQ2Ic2bSnHpIJRGW-TV3o7zb6eRkTib1xs6SDBd3PIWAZoEz-uQbJ1MXwUEETfcDLNGkGYk25WqgI0tIGbqQoG_oQ
</Trace>
1-9-2022 12:57:13 : EwsRequest --- <Trace Tag="EwsRequest" Tid="1" Time="2022-09-01 10:57:13Z" Version="15.00.0913.015">
<?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="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>UserAccount#Domain.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:Subscribe>
<m:PullSubscriptionRequest>
<t:FolderIds>
<t:FolderId Id="AQEuAAADTfhLNwPj+06PL1ijINAF1AEACMU9HL7QIUqU8ZZs9tXeAQAAAxYAAAA=" />
</t:FolderIds>
<t:EventTypes>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>CopiedEvent</t:EventType>
<t:EventType>DeletedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
<t:EventType>MovedEvent</t:EventType>
</t:EventTypes>
<t:Timeout>90</t:Timeout>
</m:PullSubscriptionRequest>
</m:Subscribe>
</soap:Body>
</soap:Envelope>
</Trace>
1-9-2022 12:57:13 : EwsResponseHttpHeaders --- <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2022-09-01 10:57:13Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
request-id: 020ba111-367c-5403-10d0-edb4d8408dc5
X-CalculatedFETarget: AM6P193CU004.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
X-RUM-Validated: 1
x-ms-appId: fdea1aff-feaa-4d04-b795-55d873f2283b
Restrict-Access-Confirm: 1
x-EwsHandler: Subscribe
X-BeSku: WCS6
X-DiagInfo: AS8PR07MB7925
X-BEServer: AS8PR07MB7925
X-Proxy-RoutingCorrectness: 1
X-Proxy-BackendServerStatus: 200
X-FEProxyInfo: AM3PR05CA0132.EURPRD05.PROD.OUTLOOK.COM
X-FEEFZInfo: AMS
X-FEServer: AM6P193CA0116,AM3PR05CA0132
X-FirstHopCafeEFZ: AMS
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Thu, 01 Sep 2022 10:57:10 GMT
Set-Cookie: exchangecookie=fae0cd80fcd944e9b2e3ac0e021b8dc8; path=/; secure
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
</Trace>
1-9-2022 12:57:13 : EwsResponse --- <Trace Tag="EwsResponse" Tid="1" Time="2022-09-01 10:57:13Z" Version="15.00.0913.015">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="5612" MinorBuildNumber="5" Version="V2018_01_08" 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" />
</s:Header>
<s:Body>
<m:SubscribeResponse 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:SubscribeResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAcX9pz2c1LEavlEM3OLE6OTYrWLgIjNoIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</m:SubscriptionId>
<m:Watermark>AQAAABTg+YC4KZFNttW01ElEHadDSGwrAAAAAAA=</m:Watermark>
</m:SubscribeResponseMessage>
</m:ResponseMessages>
</m:SubscribeResponse>
</s:Body>
</s:Envelope>
</Trace>
============= get events ==============
1-9-2022 13:00:23 : EwsRequestHttpHeaders --- <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2022-09-01 11:00:23Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0913.015
Accept-Encoding: gzip,deflate
X-AnchorMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PublicFolderMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PreferServerAffinity: True
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6InA5eWx3dnE4RW9zQzJMdjNCeklmYzZxTlh1bjVmQzl3QXAyWENGbG1QOVkiLCJhbGciOiJSUzI1NiIsIng1dCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSIsImtpZCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSJ9.eyJhdWQiOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2VkMDc0NDQxLWI4MjUtNDJjYy04ODU2LTE3YWUzYjBiMmY0Mi8iLCJpYXQiOjE2NjIwMjk1MjgsIm5iZiI6MTY2MjAyOTUyOCwiZXhwIjoxNjYyMDMzNDI4LCJhaW8iOiJFMlpnWUhob1p6K3ZvcFh0VnZWZklhK1ZvVEtWQUE9PSIsImFwcF9kaXNwbGF5bmFtZSI6IkV4Y2hhbmdlR3JvdXBDYWxlbmRhciIsImFwcGlkIjoiZmRlYTFhZmYtZmVhYS00ZDA0LWI3OTUtNTVkODczZjIyODNiIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvZWQwNzQ0NDEtYjgyNS00MmNjLTg4NTYtMTdhZTNiMGIyZjQyLyIsIm9pZCI6IjM4MDkxNzg0LWU5NzItNDk4ZS05ZTlkLTZmMGE2NzQ4MTMyZSIsInJoIjoiMC5BVThBUVVRSDdTVzR6RUtJVmhldU93c3ZRZ0lBQUFBQUFQRVB6Z0FBQUFBQUFBQlBBQUEuIiwicm9sZXMiOlsiZnVsbF9hY2Nlc3NfYXNfYXBwIl0sInNpZCI6IjE1MzQ5NThhLThmYjYtNDg4Ny05ZWU0LWFkZDM2ZGQ4ZDVlYyIsInN1YiI6IjM4MDkxNzg0LWU5NzItNDk4ZS05ZTlkLTZmMGE2NzQ4MTMyZSIsInRpZCI6ImVkMDc0NDQxLWI4MjUtNDJjYy04ODU2LTE3YWUzYjBiMmY0MiIsInV0aSI6InZtR2ZDS0ZSWTBPS2R2OTVaU0Z1QUEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdfQ.IlPfIOgl6H7Kenn999w6GPrHjPKyT_T_JLxSQc2w1Pjs8W_W4_brehe_wVX8YdqQPLEOo4fYX9l3gHHZeXtuOkgir1hM9w6TomM_FP6vBTeuGjVe7xLL0fSPvAd63pwvQicCj7SbX-RQBpvKeAapf5zA70UOYfo_NKic_ErJSWoYkSvDDX67LipjQrZ68X8XQQe3z_U7PfbwKABY91twQftzI4WXbQoRcEv8AgCQ9dxhFTIJgdzeV6slf-vnPHQ2Ic2bSnHpIJRGW-TV3o7zb6eRkTib1xs6SDBd3PIWAZoEz-uQbJ1MXwUEETfcDLNGkGYk25WqgI0tIGbqQoG_oQ
</Trace>
1-9-2022 13:00:23 : EwsRequest --- <Trace Tag="EwsRequest" Tid="1" Time="2022-09-01 11:00:23Z" Version="15.00.0913.015">
<?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="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>UserAccount#Domain.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetEvents>
<m:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAcX9pz2c1LEavlEM3OLE6OTYrWLgIjNoIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</m:SubscriptionId>
<m:Watermark>AQAAABTg+YC4KZFNttW01ElEHadDSGwrAAAAAAA=</m:Watermark>
</m:GetEvents>
</soap:Body>
</soap:Envelope>
</Trace>
1-9-2022 13:00:23 : EwsResponseHttpHeaders --- <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2022-09-01 11:00:23Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
request-id: 614cb84b-af3f-c278-0910-971429e39c7b
X-CalculatedFETarget: AS8PR04CU007.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
X-RUM-Validated: 1
x-ms-appId: fdea1aff-feaa-4d04-b795-55d873f2283b
Restrict-Access-Confirm: 1
x-EwsHandler: GetEvents
X-BeSku: WCS6
X-DiagInfo: AS8PR07MB7925
X-BEServer: AS8PR07MB7925
X-Proxy-RoutingCorrectness: 1
X-Proxy-BackendServerStatus: 200
X-FEProxyInfo: AM4P190CA0002.EURP190.PROD.OUTLOOK.COM
X-FEEFZInfo: AMS
X-FEServer: AS8PR04CA0209,AM4P190CA0002
X-FirstHopCafeEFZ: AMS
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Thu, 01 Sep 2022 11:00:20 GMT
Set-Cookie: exchangecookie=fae0cd80fcd944e9b2e3ac0e021b8dc8; path=/; secure
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
</Trace>
1-9-2022 13:00:23 : EwsResponse --- <Trace Tag="EwsResponse" Tid="1" Time="2022-09-01 11:00:23Z" Version="15.00.0913.015">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="5612" MinorBuildNumber="5" Version="V2018_01_08" 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" />
</s:Header>
<s:Body>
<m:GetEventsResponse 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:GetEventsResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Notification>
<t:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAcX9pz2c1LEavlEM3OLE6OTYrWLgIjNoIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</t:SubscriptionId>
<t:PreviousWatermark>AQAAABTg+YC4KZFNttW01ElEHadDSGwrAAAAAAA=</t:PreviousWatermark>
<t:MoreEvents>false</t:MoreEvents>
<t:StatusEvent>
<t:Watermark>AQAAABTg+YC4KZFNttW01ElEHafKVmwrAAAAAAE=</t:Watermark>
</t:StatusEvent>
</m:Notification>
</m:GetEventsResponseMessage>
</m:ResponseMessages>
</m:GetEventsResponse>
</s:Body>
</s:Envelope>
</Trace>
I cannot create any public folder in case when I set proper permission (through WebUI) to that user (in my case admin).
But when I try to update public folder`s 'EffectiveRights' to add permission level to that user I cannot do it. Which request I need to send to update user permission level on public folder or add proper 'EffectiveRights' on that public folder?
Example of the request:
POST outlook.office365.com/EWS/Exchange.asmx
Content-Type:text/xml; charset=utf-8
Accept:text/xml; charset=utf-8
BODY
<?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_SP1" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrimarySmtpAddress>test#test_test.onmicrosoft.com</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<UpdateFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<FolderChanges>
<t:FolderChange>
<t:DistinguishedFolderId Id="publicfoldersroot" />
<t:Updates>
<t:SetFolderField>
<t:FieldURI FieldURI="folder:EffectiveRights"/>
<t:Folder>
<t:EffectiveRights>
<t:CreateAssociated>false</t:CreateAssociated>
<t:CreateContents>true</t:CreateContents>
<t:CreateHierarchy>false</t:CreateHierarchy>
<t:Delete>false</t:Delete>
<t:Modify>false</t:Modify>
<t:Read>true</t:Read>
</t:EffectiveRights>
</t:Folder>
</t:SetFolderField>
</t:Updates>
</t:FolderChange>
</FolderChanges>
</UpdateFolder>
</soap:Body>
</soap:Envelope>
and the response is:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1164" MinorBuildNumber="25" Version="V2018_01_08" 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"/>
</s:Header>
<s:Body>
<m:UpdateFolderResponse 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:UpdateFolderResponseMessage ResponseClass="Error">
<m:MessageText>Set action is invalid for property.</m:MessageText>
<m:ResponseCode>ErrorInvalidPropertySet</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:MessageXml>
<t:FieldURI FieldURI="folder:EffectiveRights"/>
</m:MessageXml>
<m:Folders/>
</m:UpdateFolderResponseMessage>
</m:ResponseMessages>
</m:UpdateFolderResponse>
</s:Body>
</s:Envelope>
another one example:
POST outlook.office365.com/EWS/Exchange.asmx
Content-Type:text/xml; charset=utf-8
Accept:text/xml; charset=utf-8
BODY
<?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="Exchange2013_SP1" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrimarySmtpAddress>test#test_test.onmicrosoft.com</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:UpdateFolder>
<m:FolderChanges>
<t:FolderChange>
<t:FolderId Id="AAEuAAAAAAAaRHOQqmYRzZvIAKoAL8RaAwCOXNGsJPKoS5iTrqfBNvbzAACDSr4rAAA=" />
<t:Updates>
<t:SetFolderField>
<t:FieldURI FieldURI="folder:PermissionSet" />
<t:Folder>
<t:PermissionSet>
<t:Permissions>
<t:Permission>
<t:UserId>
<t:PrimarySmtpAddress>test#test_test.onmicrosoft.com</t:PrimarySmtpAddress>
</t:UserId>
<t:PermissionLevel>Editor</t:PermissionLevel>
</t:Permission>
</t:Permissions>
</t:PermissionSet>
</t:Folder>
</t:SetFolderField>
</t:Updates>
</t:FolderChange>
</m:FolderChanges>
</m:UpdateFolder>
</soap:Body>
</soap:Envelope>
and the response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1143" MinorBuildNumber="18" Version="V2018_01_08" 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"/>
</s:Header>
<s:Body>
<m:UpdateFolderResponse 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:UpdateFolderResponseMessage ResponseClass="Error">
<m:MessageText>Access is denied. Check credentials and try again., Underlying MAPI stream threw exception</m:MessageText>
<m:ResponseCode>ErrorAccessDenied</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Folders/>
</m:UpdateFolderResponseMessage>
</m:ResponseMessages>
</m:UpdateFolderResponse>
</s:Body>
</s:Envelope>
Because your trying to create folders in publicfoldersroot no user has rights by default to do that (this is to stop people messing up the Public Folder root). So if you want your user test#test_test.onmicrosoft.com you would need to first grant them rights to do that on the Root folder either using the EAC or Add-PublicFolderclientPermissions. I would suggest you first create a folder in the Root using the EAC and then get your code to create child folders of that, from a development point of view this is easier to cleanup when you need to delete everything and test again then trying to clear the whole root hierarchy each time.
Also only you second example will work because EffectiveRights is a calculate property so can't be updated, all you can do is update the underlying DACL of the folder which is what you second request is doing
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
I am attempting to fetch data from Taleo Enterprise SOAP API
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:itk="http://www.taleo.com/ws/integration/toolkit/2011/05/management"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>
<itk:getLargeDocumentByKey><messageKey>124110901</messageKey>
</itk:getLargeDocumentByKey></soap:Body></soap:Envelope>
and I get an error the number of entities returned by this export request (787026) has exceeded the maximum allowed (100000).
------=_Part_99112_1948897443.1507649297078
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <soap.xml#xfire.codehaus.org>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ns1:getLargeDocumentByKeyResponse xmlns:ns1="http://www.taleo.com/ws/integration/toolkit/2011/05/management">
<ns1:Document xmlns:ns2="http://www.w3.org/2004/11/xmlmime" ns2:contentType="text/xml; charset=UTF-8">
<Include xmlns="http://www.w3.org/2004/08/xop/include" href="cid:1507649297078209382008132646#http://www.w3.org/2001/XMLSchema"/>
</ns1:Document></ns1:getLargeDocumentByKeyResponse></soap:Body>
</soap:Envelope>
------=_Part_99112_1948897443.1507649297078
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-ID: <1507649297078209382008132646#http://www.w3.org/2001/XMLSchema>
<Document xmlns="http://www.taleo.com/ws/integration/toolkit/2011/05">
<Attributes><Attribute name="count">0</Attribute>
<Attribute name="duration">0:00:00.790</Attribute>
<Attribute name="mode">T-XML</Attribute>
<Attribute name="version">http://www.taleo.com/ws/tee800/2009/01</Attribute></Attributes>
<Content><ExportErrors><Error>
<Code>ServerError</Code><Subcode>itk:ExportTooManyRecords</Subcode>
<Reason>The number of entities returned by this export request (787026) has exceeded the maximum allowed (100000).</Reason></Error></ExportErrors>
</Content></Document>
------=_Part_99112_1948897443.1507649297078--
Is there any way to split or limit of the export. Any help is much appreciated.
Thank you.
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