how to recall Items using EWS?

97 Views Asked by At

How to recall Items using EWS?

<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="Exchange2010_SP2"/>
  </soap:Header>
  <soap:Body>
    <RecallItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
                xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <t:ItemIds>
        <t:ItemId Id="[ItemId]"/>
      </t:ItemIds>
      <t:DeleteType>SendOnly</t:DeleteType>
      <t:SuppressReadReceipts>false</t:SuppressReadReceipts>
    </RecallItem>
  </soap:Body>
</soap:Envelope>

The code above not work. It returns ErrorInvalidRequest. How to recall items?

1

There are 1 best solutions below

2
Eugene Astafiev On

Message recall is available after you click Send and is available only if both you and the recipient have a Microsoft 365 or Microsoft Exchange email account in the same organization. So, for example, a message sent to or from a Hotmail, Gmail, or live.com account can't be recalled.

Make sure that the recipient uses Office365 or Exchange account in the same organization.

Also you may check how the Delete an item by using the EWS Managed API works.