DeleteAttachment operation
The DeleteAttachment operation is used to delete file and item attachments from an existing item in the Exchange store.
Remarks
This operation allows you to delete one or more attachments by ID.
DeleteAttachment request example
Description
The following example of a DeleteAttachment request shows how to delete an item attachment.
Code
<?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
The attachment identifier has been shortened to preserve readability.
Request elements
The following elements are used in the request:
DeleteAttachment response example
Description
The following example shows a successful response to a DeleteAttachment request.
Code
<?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
The CreateAttachment operation returns an element of AttachmentIdType type that includes a RootItemId and RootItemChangeKey. These attributes are not permitted for identifiers within a DeleteAttachment request. DeleteAttachment uses elements of type RequestAttachmentIdType, which does not include these attributes.
The DeleteAttachment response includes the ID of the parent item. When attachments are removed from an item, the item's change key is modified. The new item change key can be obtained from the DeleteAttachment response.
Note
The RootItemId identifier and ChangeKey have been shortened to preserve readability.
Successful response elements
The following elements are used in the response:
See also
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기