4.2 Creating a Folder Path
This example of the CreateFolderPath operation, as defined in section 3.1.4.2, shows how the client creates a folder path. This example creates three folders in the Inbox folder. Each folder is a child of the folder that precedes it.
-
<?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" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"> <soap:Header> <t:RequestServerVersion Version="Exchange2013" /> <t:MailboxCulture>en-US</t:MailboxCulture> <t:TimeZoneContext> <t:TimeZoneDefinition Id="GMT Standard Time"/> </t:TimeZoneContext> </soap:Header> <soap:Body > <m:CreateFolderPath> <m:ParentFolderId> <t:DistinguishedFolderId Id="inbox"/> </m:ParentFolderId> <m:RelativeFolderPath> <t:Folder> <t:DisplayName>MyFirstLevelFolder</t:DisplayName> </t:Folder> <t:Folder> <t:DisplayName>MySecondLevelFolder</t:DisplayName> </t:Folder> <t:Folder> <t:DisplayName>MyThirdLevelFolder</t:DisplayName> </t:Folder> </m:RelativeFolderPath> </m:CreateFolderPath> </soap:Body> </soap:Envelope>
The server constructs the following successful response to the request. In this response, the server creates three folders in the Inbox folder.
-
<?xml version="1.0" encoding="utf-8"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="526" MinorBuildNumber="0" Version="Exchange2013" xmlns:h=" http://schemas.microsoft.com/exchange/services/2006/types" xmlns=http://schemas.microsoft.com/exchange/services/2006/types xmlns=:xsd=http://www.w3.org/2001/XMLSchema" xmlns=:xsi=http://www.w3.org/2001/XMLSchema-instance/> </s:Header> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <m:CreateFolderPathResponse xmlns:m=http://schemas.microsoft.com/exchange/services/2006/messages xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> <m:ResponseMessages> <m:CreateFolderPathResponseMessage ResponseClass="Success"> <m:ResponseCode>NoError</m:ResponseCode> <m:Folders> <t:Folder> <t:FolderId Id="AAMkADEzOTExYjJkLTYxZDAtNDgxOC04YzQyLTU0OGY1Yzc3ZGY0MwAuAAAAAADhS2QUsLGoTbY+lhGktZkcAQCYnYF59gJhQaoeGgGqm4QrAABqxisXAAA=" ChangeKey="AQAAABYAAACYnYF59gJhQaoeGgGqm4QrAABq6Wxb"/> <t:DisplayName>MyFirstLevelFolder</t:DisplayName> <t:TotalCount>0</t:TotalCount> <t:ChildFolderCount>0</t:ChildFolderCount> <t:UnreadCount>0</t:UnreadCount> </t:Folder> </m:Folders> </m:CreateFolderPathResponseMessage> <m:CreateFolderPathResponseMessage ResponseClass="Success"> <m:ResponseCode>NoError</m:ResponseCode> <m:Folders> <t:Folder> <t:FolderId Id="AAMkADEzOTExYjJkLTYxZDAtNDgxOC04YzQyLTU0OGY1Yzc3ZGY0MwAuAAAAAADhS2QUsLGoTbY+lhGktZkcAQCYnYF59gJhQaoeGgGqm4QrAABqxisYAAA=" ChangeK="AQAAABYAAACYnYF59gJhQaoeGgGqm4QrAABq6Wxg"/> <t:DisplayName>MySecondLevelFolder</t:DisplayName> <t:TotalCount>0</t:TotalCount> <t:ChildFolderCount>0</t:ChildFolderCount> <t:UnreadCount>0</t:UnreadCount> </t:Folder> </m:Folders> </m:CreateFolderPathResponseMessage> <m:CreateFolderPathResponseMessage ResponseClass="Success"> <m:ResponseCode>NoError</m:ResponseCode> <m:Folders> <t:Folder> <t:FolderId Id="AAMkADEzOTExYjJkLTYxZDAtNDgxOC04YzQyLTU0OGY1Yzc3ZGY0MwAuAAAAAADhS2QUsLGoTbY+lhGktZkcAQCYnYF59gJhQaoeGgGqm4QrAABqxisZAAA=" ChangeKey="AQAAABYAAACYnYF59gJhQaoeGgGqm4QrAABq6Wxl"/> <t:DisplayName>MyThirdLevelFolder</t:DisplayName> <t:TotalCount>0</t:TotalCount> <t:ChildFolderCount>0</t:ChildFolderCount> <t:UnreadCount>0</t:UnreadCount> </t:Folder> </m:Folders> </m:CreateFolderPathResponseMessage> </m:ResponseMessages> </m:CreateFolderPathResponse> </s:Body> </s:Envelope>