Overview
The following operations allow you to work with folders. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with messages, see Sample configuration.
Operation | Description |
---|---|
Create a new folder | |
Delete a folder | |
Get child folder | |
Get the folder collection | |
Move a folder and its contents |
Operation details
This section provides further details on the operations related to discussions.
Create Folder
The createFolder operation creates a child folder by the name.
<outlookmail.createFolder> <folderId>{$ctx:folderId}</folderId> <displayName>{$ctx:displayName}</displayName> </outlookmail.createFolder>
Properties
folderId: Required -The folder ID, or the Inbox
, Drafts
, SentItems
, orDeletedItems
well-known folder name.
displayName: Required -The display name of the folder.
Sample request
Following is a sample REST/JSON request that can be handled by the createFolder operation.
{ "apiUrl":"https://outlook.office.com/api", "apiVersion":"v2.0", "accessToken":"accesstoken", "refreshToken":"refreshtoken", "clientSecret":"K+M5n5OidY4hJ......", "clientId":"dec93ce7-dd0f.....", "resource":"https://outlook.office.com/", "redirectUri":"http://www.wso2.com", "registryPath":"Connector/OutlookMailRegPath", "intervalTime":"", "folderId":"Inbox", "displayName":"Inbox_Child" }
Delete Folder
The deleteFolder operation deletes a folder and all of its contents.
<outlookmail.deleteFolder> <folderId>{$ctx:folderId}</folderId> </outlookmail.deleteFolder>
Properties
folderId: Required -The folder ID, or the Inbox
, Drafts
, SentItems
, orDeletedItems
well-known folder name.
Sample request
Following is a sample REST/JSON request that can be handled by the deleteFolder operation.
{ "apiUrl":"https://outlook.office.com/api", "apiVersion":"v2.0", "accessToken":"accesstoken", "refreshToken":"refreshtoken", "clientSecret":"K+M5n5OidY4hJ......", "clientId":"dec93ce7-dd0f.....", "resource":"https://outlook.office.com/", "redirectUri":"http://www.wso2.com", "registryPath":"Connector/OutlookMailRegPath", "intervalTime":"", "folderId":"Inbox" }
Get Child Folder
The getChildFolder operation gets the folder collection under the specified folder.
<outlookmail.deleteFolder> <folderId>{$ctx:folderId}</folderId> </outlookmail.deleteFolder>
Properties
folderId: Required -The folder ID, or the Inbox
, Drafts
, SentItems
, orDeletedItems
well-known folder name.
Sample request
Following is a sample REST/JSON request that can be handled by the getChildFolder operation.
{ "apiUrl":"https://outlook.office.com/api", "apiVersion":"v2.0", "accessToken":"accesstoken", "refreshToken":"refreshtoken", "clientSecret":"K+M5n5OidY4hJ......", "clientId":"dec93ce7-dd0f.....", "resource":"https://outlook.office.com/", "redirectUri":"http://www.wso2.com", "registryPath":"Connector/OutlookMailRegPath", "intervalTime":"", "folderId":"Inbox" }
Get Folder
The getFolder operation gets the folder collection under the root folder of the signed-in user.
<outlookmail.getFolder/>
Sample request
Following is a sample REST/JSON request that can be handled by the getFolder operation.
{ "apiUrl":"https://outlook.office.com/api", "apiVersion":"v2.0", "accessToken":"accesstoken", "refreshToken":"refreshtoken", "clientSecret":"K+M5n5OidY4hJ......", "clientId":"dec93ce7-dd0f.....", "resource":"https://outlook.office.com/", "redirectUri":"http://www.wso2.com", "registryPath":"Connector/OutlookMailRegPath", "intervalTime":"" }
Move Folder
The moveFolder operation moves a folder and its contents to another folder.
<outlookmail.moveFolder> <folderId>{$ctx:folderId}</folderId> <destinationId>{$ctx:destinationId}</destinationId> </outlookmail.moveFolder>
Properties
folderId: Required -The folder ID, or the Inbox
, Drafts
, SentItems
, orDeletedItems
well-known folder name.
destinationId: Required -The destination folder ID, or the Inbox
, Drafts
,SentItems
, or DeletedItems
well-known folder name.
Sample request
Following is a sample REST/JSON request that can be handled by the moveFolder operation.
{ "apiUrl":"https://outlook.office.com/api", "apiVersion":"v2.0", "accessToken":"accesstoken", "refreshToken":"refreshtoken", "clientSecret":"K+M5n5OidY4hJ......", "clientId":"dec93ce7-dd0f.....", "resource":"https://outlook.office.com/", "redirectUri":"http://www.wso2.com", "registryPath":"Connector/OutlookMailRegPath", "intervalTime":"", "folderId":"TESTFOLDER", "destinationId":"DeletedItems" }
Sample configuration
Following is a sample proxy service that illustrates how to connect to Outlookmail with the init
operation and use the createFolder operation. The sample request for this proxy can be found in createFolder sample request.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="outLook_CreateFolder" transports="https http" startOnLoad="true" trace="disable"> <description/> <target> <inSequence> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="folderId" expression="json-eval($.folderId)"/> <property name="displayName" expression="json-eval($.displayName)"/> <property name="apiVersion" expression="json-eval($.apiVersion)"/> <property name="refreshToken" expression="json-eval($.refreshToken)"/> <property name="clientSecret" expression="json-eval($.clientSecret)"/> <property name="clientId" expression="json-eval($.clientId)"/> <property name="resource" expression="json-eval($.resource)"/> <property name="redirectUri" expression="json-eval($.redirectUri)"/> <property name="registryPath" expression="json-eval($.registryPath)"/> <property name="intervalTime" expression="json-eval($.intervalTime)"/> <outlookmail.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <accessToken>{$ctx:accessToken}</accessToken> <apiVersion>{$ctx:apiVersion}</apiVersion> <refreshToken>{$ctx:refreshToken}</refreshToken> <clientSecret>{$ctx:clientSecret}</clientSecret> <clientId>{$ctx:clientId}</clientId> <resource>{$ctx:resource}</resource> <redirectUri>{$ctx:redirectUri}</redirectUri> <registryPath>{$ctx:registryPath}</registryPath> <intervalTime>{$ctx:intervalTime}</intervalTime> </outlookmail.init> <outlookmail.createFolder> <folderId>{$ctx:folderId}</folderId> <displayName>{$ctx:displayName}</displayName> </outlookmail.createFolder> <respond/> </inSequence> </target> </proxy>