locked
Soap API GetUserAvailabilityRequest returning incorrect MergedFreeBusy RRS feed

  • Question

  • Hello,

    Our team came across an inconsistency in the response of the method GetUserAvailabilityRequest, using delegation, after creating and deleting an appointment using the Soap API.

    The steps to reproduce the misbehavior we found are the following:

    1. For simplicity, find a day with no appointments in an email account's calendar handle by delegation
    2. Verify availability (GetUserAvailabilityRequest)
    3. Create an appointment in that calendar (CreateItem)
    4. Verify the appointment has been actually created (GetUserAvailabilityRequest)
    5. Delete the recently created appointment (DeleteItem)
    6. 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:

     

    1. Verify availability before creating appointments

    <MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000000000000000000000000000</MergedFreeBusy>

    1. CreateItem
    2. Verify availability after creating an appointment

    <MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000002222000000000000000000</MergedFreeBusy>

    1. DeleteItem
    2. 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 the GetUserAvailabilityRequest 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.


    Friday, January 11, 2019 5:41 AM