Hello,
Our team came across an inconsistency in the response of the methodGetUserAvailabilityRequest, using delegation, after creating and deleting an appointment using the Soap API.
The steps to reproduce the misbehavior we found are the following:
- For simplicity, find a day with no appointments in an email account's calendar handle by delegation
- Verify availability (GetUserAvailabilityRequest)
- Create an appointment in that calendar (CreateItem)
- Verify the appointment has been actually created (GetUserAvailabilityRequest)
- Delete the recently created appointment (DeleteItem)
- Verify the appointment has been actually deleted (GetUserAvailabilityRequest)
Current result: At this point, the free-busy result seems to be inaccurate and shows some busy slots that should be free.
Expected result: A day with no appointments.
It is worth to mention that the
appointment is removed from the calendar, i.e. Outlook/OWA calendar. However, if we make a request for getting a user availability, the response is not updated.
Here are the requests we are executing when performing these tasks.
GetUserAvailabilityRequest |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"> <soapenv:Header> <typ:RequestServerVersion Version="Exchange2007_SP1"/> </soapenv:Header> <soapenv:Body> <mes:GetUserAvailabilityRequest> <!--Optional:--> <typ:TimeZone> <typ:Bias>300</typ:Bias> <typ:StandardTime> <typ:Bias>0</typ:Bias> <typ:Time>02:00:00</typ:Time> <typ:DayOrder>1</typ:DayOrder> <typ:Month>11</typ:Month> <typ:DayOfWeek>Sunday</typ:DayOfWeek> </typ:StandardTime> <typ:DaylightTime> <typ:Bias>-60</typ:Bias> <typ:Time>02:00:00</typ:Time> <typ:DayOrder>2</typ:DayOrder> <typ:Month>3</typ:Month> <typ:DayOfWeek>Sunday</typ:DayOfWeek> </typ:DaylightTime> </typ:TimeZone> <mes:MailboxDataArray> <!--Zero or more repetitions:--> <typ:MailboxData> <typ:Email> <typ:Address>365test2@ttops.onmicrosoft.com</typ:Address> </typ:Email> <typ:AttendeeType>Organizer</typ:AttendeeType> </typ:MailboxData> </mes:MailboxDataArray> <!--Optional:--> <typ:FreeBusyViewOptions> <typ:TimeWindow> <typ:StartTime>2018-11-20T00:00:00</typ:StartTime> <typ:EndTime>2018-11-21T00:00:00</typ:EndTime> </typ:TimeWindow> <typ:RequestedView>MergedOnly</typ:RequestedView> </typ:FreeBusyViewOptions> </mes:GetUserAvailabilityRequest> </soapenv:Body> </soapenv:Envelope> |
CreateItem |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"> <soapenv:Header> <typ:RequestServerVersion Version="Exchange2007_SP1"/> </soapenv:Header> <soapenv:Body> <mes:CreateItem MessageDisposition="SaveOnly" SendMeetingInvitations="SendToNone"> <mes:SavedItemFolderId> <typ:DistinguishedFolderId Id="calendar"> <typ:Mailbox> <typ:EmailAddress>email_account@domain.com</typ:EmailAddress> </typ:Mailbox> </typ:DistinguishedFolderId> </mes:SavedItemFolderId> <mes:Items> <typ:CalendarItem> <typ:Subject>Test appointment</typ:Subject> <typ:Body BodyType="Text">Body text</typ:Body> <typ:ReminderIsSet>true</typ:ReminderIsSet> <typ:ReminderMinutesBeforeStart>10</typ:ReminderMinutesBeforeStart> <typ:Start>2018-11-20T18:00:00Z</typ:Start> <typ:End>2018-11-20T20:00:00Z</typ:End> <typ:Location>My Office</typ:Location> <typ:IsResponseRequested>false</typ:IsResponseRequested> </typ:CalendarItem> </mes:Items> </mes:CreateItem> </soapenv:Body> </soapenv:Envelope> |
DeleteItem |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"> <soapenv:Header> <typ:RequestServerVersion Version="Exchange2007_SP1"/> </soapenv:Header> <soapenv:Body> <mes:DeleteItem DeleteType="SoftDelete" SendMeetingCancellations="SendToAllAndSaveCopy" AffectedTaskOccurrences="AllOccurrences"> <mes:ItemIds> <typ:ItemId Id="itemid_previously_created" ChangeKey="DwAAABYAAAD"/> </mes:ItemIds> </mes:DeleteItem> </soapenv:Body> </soapenv:Envelope> |
NOTE: The item ID and ChangeKey have been shortened to preserve readability. |
We are interested in a portion of the reponse:
MergedFreeBusy.
By executing these requests in the order mentioned above, we get the following responses:
- Verify availability before creating appointments
<MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000000000000000000000000000</MergedFreeBusy>
- CreateItem
- Verify availability after creating an appointment
<MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000002222000000000000000000</MergedFreeBusy>
- DeleteItem
- Verify availability after deleting the appointment
<MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000002222000000000000000000</MergedFreeBusy>
Waiting for the server to update the information does not seem to work. Once we get to this inconsistency, it remains in time.
Additionally, if we create or modify a calendar item, e.g. if we create an appointment the same day but an hour before and we check for the availability, we get the right result.
We believe there is an issue with either the API or the 365 server not updating. Outlook shows the appointment as correctly deleted, but theGetUserAvailabilityRequest
SOAP API method returns the timeslot as unavailable even after it has been deleted. We believe this is a bug with the API.
Are there any workarounds for this issue? Is there an (undocumented?) API call to "refresh" the server so that it returns the correct freebusy string?
Any help appreciated.