none
Create appointment using EWS and set BusyType with XML RRS feed

  • Question

  • Hi guys,

    I have Exchange 2010 and am trying to create a calendar appointment using EWS with XML.  Everything works fine, but the "BusyType" option doesn't work.  I want the appointment to show in the calendar as "Free", but instead it shows as "Busy".  Here is what I have for the XML:

    <?xml version="1.0" encoding="utf-16"?>
    <CreateItemType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SendMeetingInvitations="SendToNone">
    <SavedItemFolderId xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
    <DistinguishedFolderId Id="calendar" xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
    <Mailbox>
    <EmailAddress>{ItemProperty:OTManager_x0020_Display_x0020_Name}</EmailAddress>
    <MailboxType>Mailbox</MailboxType>
    </Mailbox>
    </DistinguishedFolderId>
    </SavedItemFolderId>
    <Items xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
    <CalendarItem xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
    <ItemClass>IPM.Appointment</ItemClass>
    <Subject>Other Leave for {Common:InitiatorsDisplayName}</Subject>
    <Body BodyType="Text">Leave request</Body>
    <Location>
    </Location>
    <Importance>Normal</Importance>
    <Start>{ItemProperty:OTFrom}</Start>
    <End>{ItemProperty:OTTo}</End>
    <BusyType>Free</BusyType>
    </CalendarItem>
    </Items>
    </CreateItemType>

    I've also tried using "LegacyFreeBusyStatus" which also didn't work.  Can someone tell me how to modify my XML so that the appointment shows as "Free"?  The actual XML was generated using a workflow tool called "Nintex Workflow 2010", and I simply added the BusyType option to it.  I'm not sure if that makes a difference or not.  Thanks in advance!

    Tuesday, February 4, 2014 12:06 AM

Answers

  • BusyType is not an element of the CalendarItem type it belongs to the CalendarEvent type which is part of the GetUserAvailability operation. There is a full list of CalendarItem elements on http://msdn.microsoft.com/en-us/library/office/aa564765(v=exchg.150).aspx (note the order of the elements is critical). You should be using the LegacyFreeBusyStatus eg the following works okay for me

            <m:Items>
              <t:CalendarItem>
                <t:Subject>tta</t:Subject>
                <t:Start>2014-02-04T12:53:33.970+11:00</t:Start>
                <t:End>2014-02-04T13:53:33.972+11:00</t:End>
                <t:LegacyFreeBusyStatus>Free</t:LegacyFreeBusyStatus>
              </t:CalendarItem>
            </m:Items>

    Cheers
    Glen

    • Marked as answer by RDBarg Tuesday, February 4, 2014 6:08 PM
    Tuesday, February 4, 2014 2:00 AM

All replies

  • BusyType is not an element of the CalendarItem type it belongs to the CalendarEvent type which is part of the GetUserAvailability operation. There is a full list of CalendarItem elements on http://msdn.microsoft.com/en-us/library/office/aa564765(v=exchg.150).aspx (note the order of the elements is critical). You should be using the LegacyFreeBusyStatus eg the following works okay for me

            <m:Items>
              <t:CalendarItem>
                <t:Subject>tta</t:Subject>
                <t:Start>2014-02-04T12:53:33.970+11:00</t:Start>
                <t:End>2014-02-04T13:53:33.972+11:00</t:End>
                <t:LegacyFreeBusyStatus>Free</t:LegacyFreeBusyStatus>
              </t:CalendarItem>
            </m:Items>

    Cheers
    Glen

    • Marked as answer by RDBarg Tuesday, February 4, 2014 6:08 PM
    Tuesday, February 4, 2014 2:00 AM
  • Thanks Glen!

    I thought I tried the LegacyFreeBusyStatus but I must have put it in the wrong order.  This works great now!

    Ryan

    Tuesday, February 4, 2014 6:08 PM