DeleteAttachment 操作

DeleteAttachment 操作は、Exchange ストア内の既存のアイテムからファイルとアイテムの添付ファイルを削除するために使用されます。

注釈

この操作を使用すると、ID で 1 つ以上の添付ファイルを削除できます。

DeleteAttachment 要求の例

説明

次の DeleteAttachment 要求の例は、アイテムの添付ファイルを削除する方法を示しています。

コード

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Body>
    <DeleteAttachment xmlns="https://schemas.microsoft.com/exchange/services/2006/messages"
                      xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
      <AttachmentIds>
        <t:AttachmentId Id="AAAtAEFkbWluaX"/>
      </AttachmentIds>
    </DeleteAttachment>
  </soap:Body>
</soap:Envelope>

Comments

添付ファイル識別子は、読みやすさを維持するために短縮されました。

要求要素

要求では、次の要素が使用されます。

DeleteAttachment 応答の例

説明

次の例は、DeleteAttachment 要求に対する正常な応答を示しています。

コード

<?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="0" MajorBuildNumber="662" MinorBuildNumber="0" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"/>
  </soap:Header>
  <soap:Body>
    <DeleteAttachmentResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
                              xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" 
                              xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <m:ResponseMessages>
        <m:DeleteAttachmentResponseMessage xsi:type="m:DeleteAttachmentResponseMessageType" ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:RootItemId RootItemId="AAAtAEFkbWluaXN..." RootItemChangeKey="CQAAABYAA..."/>
        </m:DeleteAttachmentResponseMessage>
      </m:ResponseMessages>
    </DeleteAttachmentResponse>
  </soap:Body>
</soap:Envelope>

Comments

CreateAttachment 操作は、 RootItemIdRootItemChangeKey を含む AttachmentIdType 型の要素を返します。 これらの属性は、DeleteAttachment 要求内の識別子に対しては許可されません。 DeleteAttachment では、RequestAttachmentIdType 型の要素が使用されます。これらの属性は含まれません。

DeleteAttachment 応答には、親項目の ID が含まれています。 アイテムから添付ファイルが削除されると、アイテムの変更キーが変更されます。 新しい項目変更キーは、DeleteAttachment 応答から取得できます。

注:

読みやすくするために 、RootItemId 識別子と ChangeKey が短縮されました。

成功した応答要素

応答では、次の要素が使用されます。

関連項目