Folders

Base Path: /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/folders

Version: 3.5.0

A folder is a container that stores messages and other folders. By default, a Communicate Webmail mailbox contains four system folders -- Inbox, Drafts, Sent and Trash. A folder that you create is called a personal folder. You can only create, rename, delete or move personal folders.

Authorization: OAuth 2.0 Bearer token is required to access the resources of this API. Once signed up, credentials and URL to access the OAuth API can be found on My Apps Page.


Methods

Retrieve folder list

GET /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/folders/

Retrieves all the folders and sub-folders, for the specified mailbox, in alphabetical order.


Parameters

Name

Type

Data Type

Description


Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully retrieved the list of folders.


application/json+fhir

401

Your API key or access token has expired or is invalid.

Sample Request

curl -X GET "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/folders/" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'

Create folder

POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/folders/

Creates a new folder in the specified path.


Parameters

Name

Type

Data Type

Description


Name:

body

required

Type:

body

Data Type:

Description:

Body of the request.

Sample Payload:

{
  "folderPath": "INBOX.SubFolder"
}




Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

201

Successfully created the folder.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

409

Cannot create the folder as we have detected another folder, with that name, in the specified path.

Sample Request

curl -X POST "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/folders/" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"folderPath":"INBOX.SubFolder"}'

Move or rename folder

PUT /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/folders/{folderPath}

Moves the selected folder, along with any messages, to another folder. Also used to rename a folder.


Parameters

Name

Type

Data Type

Description


Name:

folderPath

required

Type:

path

Data Type:

string

Description:

URL-encoded path of the folder or sub-folder. A period (.) separates the sub-folder from the folder.


Sample Value: Inbox.FolderToBeMoved



Name:

body

required

Type:

body

Data Type:

Description:

Body of the request.

Sample Payload:

{
  "folderPath": "destination.FolderToBeMoved"
}




Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully moved or renamed the folder.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

409

Cannot move or rename the folder as we have detected another folder, with that name, in the specified path.

Sample Request

curl -X PUT "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/folders/Inbox.FolderToBeMoved" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"folderPath":"destination.FolderToBeMoved"}'

Delete folder

DELETE /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/folders/{folderPath}

Deletes the selected folder and moves the folder, along with any messages, to the Trash folder.


Parameters

Name

Type

Data Type

Description


Name:

folderPath

required

Type:

path

Data Type:

string

Description:

URL-encoded path of the folder or sub-folder. A period (.) separates the sub-folder from the folder.


Sample Value: folderToDelete



Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully deleted the folder.


application/json+fhir

401

Your API key or access token has expired or is invalid.

Sample Request

curl -X DELETE "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/folders/folderToDelete" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'