Attachments

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

Version: 3.5.0

Attachments are files that you upload to your email message to transfer images and documents to another party. The Communicate Webmail API enables you to upload or download a single file with each request. It respects any system limitations on uploaded files, such as the maximum file size (which is 50 MB) and the permissible file types.

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

Upload attachment

POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/attachment/{attachmentGroupId}

Uploads a file to a message. The following checks are carried out when uploading the file:

  • Viruses – If a trojan, virus, malware or other malicious threat is detected, your attachment is not saved on the mail server.

  • File size – The size cannot exceed 50 MB, either as a single file or in aggregate.

  • File type – To prevent malicious files and other illegal software from being uploaded to the Webmail server, you cannot attach files with the following extensions to your message — ade, adp, bat, chm, cmd, com, cpl, exe, hta, ins, isp, jse, lib, lnk, mde, msc, msp, mst, pif, scr, sct, shb, sys, vb, vbe, vbs, vxd, wsc, wsf, wsh, sh, js, tar, tgz, taz, z, gz, rar, bz2, bz


Parameters

Name

Type

Data Type

Description


Name:

attachmentGroupId

required

Type:

path

Data Type:

string

Description:

Unique identifier of the group that contains the attachment.


Sample Value: 12



Name:

file

required

Type:

formData

Data Type:

file

Description:

File itself.




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

The file was uploaded successfully.


application/json+fhir

400

One of the following has occurred:

  • Upload contains more than one attachment. Please ensure that only one attachment is uploaded at a time.
  • The size has exceeded 50 MB, either as a single file or in aggregate.
  • The file type is barred.
  • The file contains malware.


application/json+fhir

401

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

Sample Request

curl -X POST "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/attachment/12" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'file=undefined'

Check total attachment size

POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/attachment/{attachmentGroupId}/size

Checks that the total size of all the attachments does not exceed 50 MB.


Parameters

Name

Type

Data Type

Description


Name:

attachmentGroupId

required

Type:

path

Data Type:

string

Description:

Unique identifier of the group that contains the attachment.


Sample Value: 12



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

If successful, the API responds with:

  • the total size of all the attachments.
  • a boolean value indicating whether the file size limit has been exceeded.


application/json+fhir

401

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


application/json+fhir

404

Cannot find an attachment group with that unique identifier.

Sample Request

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

Cancel attachment upload

DELETE /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/attachment/{attachmentGroupId}/{attachmentId}

Stops the upload, and removes the attachment from the message.


Parameters

Name

Type

Data Type

Description


Name:

attachmentGroupId

required

Type:

path

Data Type:

string

Description:

Unique identifier of the group that contains the attachment.


Sample Value: 12



Name:

attachmentId

required

Type:

path

Data Type:

string

Description:

Unique identifier of the attachment whose upload must be canceled.


Sample Value: 34



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 removed the attachment from the message.


application/json+fhir

401

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


application/json+fhir

404

Cannot find an attachment group or attachment with that unique identifier.

Sample Request

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