4.1 AddDelegate Operation

The following example shows an AddDelegate request to give user1 delegate permissions on folders that are owned by user2. User1 is given Author-level permissions to user2's Calendar folder and Reviewer-level permissions to user2's Contacts folder. User1 will not receive copies of meeting messages and will be unable to view private items in user2's mailbox. Meeting requests will be sent to both user1 and user2.

 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
   <soap:Header>
     <t:RequestServerVersion Version="Exchange2013"/>
   </soap:Header>
   <soap:Body xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
     <AddDelegate>
       <Mailbox>
         <t:EmailAddress>user2@example.com</t:EmailAddress>
       </Mailbox>
       <DelegateUsers>
         <t:DelegateUser>
           <t:UserId>
             <t:PrimarySmtpAddress>user1@example.com</t:PrimarySmtpAddress>
           </t:UserId>
           <t:DelegatePermissions>
             <t:CalendarFolderPermissionLevel>Author</t:CalendarFolderPermissionLevel>
             <t:ContactsFolderPermissionLevel>Reviewer</t:ContactsFolderPermissionLevel>
           </t:DelegatePermissions>
           <t:ReceiveCopiesOfMeetingMessages>false</t:ReceiveCopiesOfMeetingMessages>
           <t:ViewPrivateItems>false</t:ViewPrivateItems>
         </t:DelegateUser>
       </DelegateUsers>
       <DeliverMeetingRequests>DelegatesAndMe</DeliverMeetingRequests>
     </AddDelegate>
   </soap:Body>
 </soap:Envelope>

The following example shows a successful AddDelegate response to an AddDelegate request.

 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Header>
     <t:ServerVersionInfo MajorVersion="8" 
              MinorVersion="1" 
              MajorBuildNumber="206" 
              MinorBuildNumber="0" 
              Version="Exchange2013" 
              xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"/>
   </soap:Header>
   <soap:Body>
     <m:AddDelegateResponse
            xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 
            ResponseClass="Success" 
            xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
       <m:ResponseCode>NoError</m:ResponseCode>
       <m:ResponseMessages>
         <m:DelegateUserResponseMessageType ResponseClass="Success">
           <m:ResponseCode>NoError</m:ResponseCode>
           <m:DelegateUser>
               <t:UserId>
                 <t:SID>S-1-5-21-1333220396-2200287332-232816053-1116</t:SID>
                 <t:PrimarySmtpAddress>User1@example.com</t:PrimarySmtpAddress>
                 <t:DisplayName>User1</t:DisplayName>
               </t:UserId>
               <t:ReceiveCopiesOfMeetingMessages>false</t:ReceiveCopiesOfMeetingMessages>
             <t:ViewPrivateItems>false</t:ViewPrivateItems>
             </m:DelegateUser>
         </m:DelegateUserResponseMessageType>
       </m:ResponseMessages>
     </m:AddDelegateResponse>
   </soap:Body>
 </soap:Envelope>