none
[EWS] Modifying meeting attendees

    Question

  • Hi,

     

    It is unclear to me how to add or delete an attendee from an existing meeting.  I would like the option, if possible, to send an update only to newly added attendees, or a cancellation to the removed attendees.  And, unaffected attendees should maintain their response status.

     

    Thanks in advance!

    Tuesday, August 21, 2007 5:05 PM

Answers

  • Hello JP_KIM,

     

    To remove attendees from a list, you make an UpdateItem call on the CalendarItem, and use the SetItemField to update the attendee list with all the current attendees you want on the list.  For example, if you have an existing meeting with two attendees (Andy, and Bob), and you want to add Carol, and remove Bob, you would call UpdateItem with the SetItemField for calendar:RequiredAttendees set to Andy and Carol.

     

    Code Snippet
    <m:UpdateItem ConflictResolution="AutoResolve" SendMeetingInvitationsOrCancellations="SendOnlyToChanged" xmlns:m="http://.../messages" xmlns:t="http://.../types">
     <m:ItemChanges>
        <t:ItemChange>
          <t:ItemId Id="AAApAHByaW5ja..." ChangeKey="DwAAA..." />
          <t:Updates>
            <!-- When using SetItemField, we must specify all Required Attendees -->
            <t:SetItemField>
              <t:FieldURI FieldURI="calendar:RequiredAttendees" />
              <t:CalendarItem>
                <t:RequiredAttendees>
                  <t:Attendee>
                    <t:Mailbox>
                      <t:Name>Andy</t:Name>
                      <t:EmailAddress>andy@contoso.com</t:EmailAddress>
                    </t:Mailbox>
                  </t:Attendee>
                  <t:Attendee>
                    <t:Mailbox>
                      <t:Name>Carol</t:Name>
                      <t:EmailAddress>carol@contoso.com</t:EmailAddress>
                    </t:Mailbox>
                  </t:Attendee>
                </t:RequiredAttendees>
              </t:CalendarItem>
            </t:SetItemField>
          </t:Updates>
        </t:ItemChange>
      </m:ItemChanges>
    </m:UpdateItem>

     

     

     

    The SendMeetingInvitationsOrCancellations property on the UpdateItem web method controls this for you.  This property can be one of the values from the CalendarItemUpdateOperationType enumeration:

     

     

    Code Snippet

    <xs:simpleType name="CalendarItemUpdateOperationType">

    <xs:restriction base="xs:string">

    <xs:enumeration value="SendToNone" />

    <xs:enumeration value="SendOnlyToAll" />

    <xs:enumeration value="SendOnlyToChanged" />

    <xs:enumeration value="SendToAllAndSaveCopy" />

    <xs:enumeration value="SendToChangedAndSaveCopy" />

    </< FONT>xs:restriction>

    </< FONT>xs:simpleType>

     

     

    In our above call, I used the SendOnlyToChanged flag, which will only notify those attendees whose registration has changed, i.e.:

    Carol - receives a 'new' meeting request

    Bob - receives a meeting cancellation

    Andy - received nothing

     

    The same behavior would have occured if I used the SendToChangedAndSaveCopy flag, (except that I would have recieved a copy of the outbound meeting message in my SentItems folder.)

     

    If I had used the SendOnlyToAll flag instead, then the results for Carol and Bob would have been the same, but Andy would have received an updated meeting message with the current attendee list as well, i.e.:

    Carol - receives a 'new' meeting request

    Bob - receives a meeting cancellation

    Andy - receives an 'updated' meeting request (which to him, looks identical, expect that it now shows Carol as being invited and Bob as not)

     

    Natrually, the SendToChangedAndSaveCopy flag does this as well.

     

     

    Now, if all you want to do is "add" attendees without notifying exiting attendees, then you would use the AppendToItemField instead of SetItemField in your UpdateItem call, and simply provide the new attendees instead of re-listing all of the existing ones.  The SendMeetingInvitationsOrCancellations value will behave in the same way.

     

    There is no such things as a "RemoveFromItemField" in EWS, there is a DeleteItemField, but that would only serve to remove all attendees, and is not the behavior that you want.

     

    See MSDN for more info on the UpdateItem command and the SendMeetingInvitationsOrCancellations flag.

    http://msdn2.microsoft.com/en-us/library/aa581084.aspx

     

     

    Hope this helps...

    - ben

    Thursday, August 23, 2007 4:33 PM

All replies

  • Hello JP_KIM,

     

    To remove attendees from a list, you make an UpdateItem call on the CalendarItem, and use the SetItemField to update the attendee list with all the current attendees you want on the list.  For example, if you have an existing meeting with two attendees (Andy, and Bob), and you want to add Carol, and remove Bob, you would call UpdateItem with the SetItemField for calendar:RequiredAttendees set to Andy and Carol.

     

    Code Snippet
    <m:UpdateItem ConflictResolution="AutoResolve" SendMeetingInvitationsOrCancellations="SendOnlyToChanged" xmlns:m="http://.../messages" xmlns:t="http://.../types">
     <m:ItemChanges>
        <t:ItemChange>
          <t:ItemId Id="AAApAHByaW5ja..." ChangeKey="DwAAA..." />
          <t:Updates>
            <!-- When using SetItemField, we must specify all Required Attendees -->
            <t:SetItemField>
              <t:FieldURI FieldURI="calendar:RequiredAttendees" />
              <t:CalendarItem>
                <t:RequiredAttendees>
                  <t:Attendee>
                    <t:Mailbox>
                      <t:Name>Andy</t:Name>
                      <t:EmailAddress>andy@contoso.com</t:EmailAddress>
                    </t:Mailbox>
                  </t:Attendee>
                  <t:Attendee>
                    <t:Mailbox>
                      <t:Name>Carol</t:Name>
                      <t:EmailAddress>carol@contoso.com</t:EmailAddress>
                    </t:Mailbox>
                  </t:Attendee>
                </t:RequiredAttendees>
              </t:CalendarItem>
            </t:SetItemField>
          </t:Updates>
        </t:ItemChange>
      </m:ItemChanges>
    </m:UpdateItem>

     

     

     

    The SendMeetingInvitationsOrCancellations property on the UpdateItem web method controls this for you.  This property can be one of the values from the CalendarItemUpdateOperationType enumeration:

     

     

    Code Snippet

    <xs:simpleType name="CalendarItemUpdateOperationType">

    <xs:restriction base="xs:string">

    <xs:enumeration value="SendToNone" />

    <xs:enumeration value="SendOnlyToAll" />

    <xs:enumeration value="SendOnlyToChanged" />

    <xs:enumeration value="SendToAllAndSaveCopy" />

    <xs:enumeration value="SendToChangedAndSaveCopy" />

    </< FONT>xs:restriction>

    </< FONT>xs:simpleType>

     

     

    In our above call, I used the SendOnlyToChanged flag, which will only notify those attendees whose registration has changed, i.e.:

    Carol - receives a 'new' meeting request

    Bob - receives a meeting cancellation

    Andy - received nothing

     

    The same behavior would have occured if I used the SendToChangedAndSaveCopy flag, (except that I would have recieved a copy of the outbound meeting message in my SentItems folder.)

     

    If I had used the SendOnlyToAll flag instead, then the results for Carol and Bob would have been the same, but Andy would have received an updated meeting message with the current attendee list as well, i.e.:

    Carol - receives a 'new' meeting request

    Bob - receives a meeting cancellation

    Andy - receives an 'updated' meeting request (which to him, looks identical, expect that it now shows Carol as being invited and Bob as not)

     

    Natrually, the SendToChangedAndSaveCopy flag does this as well.

     

     

    Now, if all you want to do is "add" attendees without notifying exiting attendees, then you would use the AppendToItemField instead of SetItemField in your UpdateItem call, and simply provide the new attendees instead of re-listing all of the existing ones.  The SendMeetingInvitationsOrCancellations value will behave in the same way.

     

    There is no such things as a "RemoveFromItemField" in EWS, there is a DeleteItemField, but that would only serve to remove all attendees, and is not the behavior that you want.

     

    See MSDN for more info on the UpdateItem command and the SendMeetingInvitationsOrCancellations flag.

    http://msdn2.microsoft.com/en-us/library/aa581084.aspx

     

     

    Hope this helps...

    - ben

    Thursday, August 23, 2007 4:33 PM
  • Thanks, that did help.  I was confused about not having the "RemoveFromItemField" option to complement the AppendToItemField.

     

    So I have one additional question:

     

    Will EWS maintain the "inherited" attendee relationship between recurring meetings and its exceptions?  The behavior I'm expecting is this:

    1) Andy, Bob, Carol are invited to the recurring meeting.

    2) I removing Bob from an exception via SetItemField, specifying Andy, Carol.

    3) I remove Andy from the recurring meeting via SetItemField specifying Bob, Carol.

     

    This should result in the exception having just Carol as an attendee.  Is this what will happen?

    Friday, August 24, 2007 2:57 PM