Base Path: /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/folders/Drafts/messages
Version: 3.5.0
The Draft API creates a draft message and saves it to the Drafts folder.
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.
POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/folders/Drafts/messages/create
Creates a new message and saves it to the Drafts folder.
Name
Type
Data Type
Description
Name:
body
required
Type:
body
Data Type:
Description:
Body of the request.
Sample Payload:
{
"to": [
{
"name": "example",
"address": "example.portal@example.com"
}
],
"cc": [],
"subject": "create draft example",
"draft": true,
"priority": "normal",
"attachmentGroupId": null,
"attachmentInfo": [],
"content": {
"alternatives": [
{
"contentType": "text/html",
"value": "example text inside draft email
"
}
]
},
"patientIdentifier": null,
"ccdaTransmission": false
}
Name:
mailboxAddress
required
Type:
path
Data Type:
string
Description:
URL-encoded address of the mailbox.
Sample Value: developer.portal@example.com
201
Successfully created a draft message.
400
Your request was invalid. A parameter, or the data in a parameter, may be incorrect.
401
Your API key or access token has expired or is invalid.
404
Cannot retrieve one or more message attachments.
413
The total size of all the attachments exceeds 50 MB.
curl -X POST "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/folders/Drafts/messages/create" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"to":[{"name":"example","address":"example.portal@example.com"}],"cc":[],"subject":"create draft example","draft":true,"priority":"normal","attachmentGroupId":null,"attachmentInfo":[],"content":{"alternatives":[{"contentType":"text/html","value":"<p>example text inside draft email</p>"}]},"patientIdentifier":null,"ccdaTransmission":false}'