MoveItem operation
The MoveItem operation is used to move one or more items to a single destination folder.
MoveItem request example
Description
The following example of a MoveItem request shows how to move an item to the Drafts folder.
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="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<MoveItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<ToFolderId>
<t:DistinguishedFolderId Id="drafts"/>
</ToFolderId>
<ItemIds>
<t:ItemId Id="AAAtAEF/swbAAA=" ChangeKey="EwAAABYA/s4b"/>
</ItemIds>
</MoveItem>
</soap:Body>
</soap:Envelope>
Comments
The ToFolderId element specifies the folder to which the items will be moved. Note that all items listed in the ItemIds collection will end up in the destination folder. You must make separate MoveItem calls to place items in different destination folders.
Note
The item identifier and change key have been shortened to preserve readability.
Request elements
The following elements are used in the request:
MoveItem response example
Description
The following example shows a successful response to a MoveItem request.
The item identifier of the new item is returned in the response message. Item identifiers are not returned in responses for cross-mailbox or mailbox to public folder MoveItem operations.
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="http://schemas.microsoft.com/exchange/services/2006/types"/>
</soap:Header>
<soap:Body>
<MoveItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:MoveItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Message>
<t:ItemID Id="AAMkAd" ChangeKey="FwAAABY" />
</t:Message>
</m:Items>
</m:MoveItemResponseMessage>
</m:ResponseMessages>
</MoveItemResponse>
</soap:Body>
</soap:Envelope>
Comments
The MoveItem operation will indicate success if the move was successful.
Successful response elements
The following elements are used in the response:
See also
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기