Mailbox API – Mails

Axigen Documentation

The Mailbox API is available starting with Axigen X4 (10.4).

List

Query parameters

Name

Type

Required

Values

Description

folderId

String

*

The folder ID

sort

String


"subject", "from", "to", "date", "size", "isUnread", "isFlagged", "importance", "hasAttachments", “folderName”

The sorting field. Note that “folderName” can be used for listing temporary search folders only.

Default value: last provided value or "date" if not yet set

dir

String


"ASC", "DESC"

The sorting direction

Default value: last provided value or "DESC" if not yet set

start

Number



The starting position

Default value: 0

limit

Number



The maximum number of retrieved items

Default value: the WebMailData pageSize

activeMailId

String



The active mail ID is used to generate the activeRowIndex property.

Note: this is used to compute server-side the absolute index in the list for the provided mail item (used mainly for clients to restore selections etc.)

syncTokenOnly

Boolean

 

 

When true, the endpoint should only return the syncToken without the folder list.

Default value: false

Response

Get

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Response

If successful, the response will contain an instance of mail.

Update

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Request body (JSON)

Name

Type

Required

Values

Description

isUnread

Boolean



The unread / read value

isFlagged

Boolean



The flagged / not flagged value

Response

If successful, the response will contain an instance of mail.

Move

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Request body (JSON)

Name

Type

Required

Values

Description

destinationFolderId

String

*


The destination folder ID

Response

If successful, the response will contain an instance of mail.

Copy

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Request body (JSON)

Name

Type

Required

Values

Description

destinationFolderId

String



The destination folder ID

Response

If successful, the response will contain an instance of mail.

Delete

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Response

If successful, the response will be empty.

Body

Get

URL parameters

Name

Type

Required

Values

Description

mailId

String

*

The mail ID

Query parameters

Name

Type

Required

Values

Description

type

String

"text", "html"

Default value: "html"

The preferred body type

showExternalImages

Boolean

Default value: depending on the body filtering level – true for low, medium filtering, false for no filtering or high filtering.

Controls the automatic download of external images

Response

Get Full Body

This endpoint should be called for emails with a long body – i.e. the Get body returns "isTruncated": true

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Response

The full email body (raw).

Attachments

List

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Response

Download All

Response

A zip archive containing all the non-inline attachments.

Get

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

attachmentId

Number

*

The attachment ID

Response

The attachment – served using Content-Disposition: inline in the response header.

Download

The Get and Download endpoints have the same response except for the Content-Disposition HTTP header.
If you want to display the attachment (or delegate the decision to the browser, if you are working with the Mailbox API from a browser based application), use the Get endpoint.
Alternatively, to force the attachment download, use the Download endpoint.

It’s also possible to make this decision based on the attachment’s Content-Type – i.e. show some attachments vs. download others, in which case you can rely on the List endpoint.

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

attachmentId

Number

*

The attachment ID

Response

The attachment – served using Content-Disposition: attachment in the response header.

Get Thumbnail

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

attachmentId

Number

*

The attachment ID

Query parameters

Name

Type

Required

Values

Description

width

Number

10-1024

The needed width / height in pixels.

If the actual size of the image is bigger (in both width and height), it will be resized so that its dimensions cover the given width / height while maintaining its original aspect ratio.

If the actual size of the image is smaller (in either width or height), its original size will be kept, with no resizing being performed.

Note: the width / height of the returned thumbnail will be 1024px.

Examples:

  • Request: 64x64; original image: 1024x1024 => returned image: 64x64

  • Request: 64x64; original image: 1024x512 => returned image: 128x64

  • Request: 64x64; original image: 1024x30 => returned image: 1024x30 (original image)

  • Request: 64x64; original image: 2048x30 => returned image: 1024x15

  • Request 64x64; original image: 30x1024 => returned image: 30x1024 (original image)

  • Request 64x64; original image: 30x20 => returned image: 30x20 (original image)

height

Number

10-1024

Response

The attachment thumbnail, for images only; empty for all other attachments.

Get EML Attachment

This endpoint can be used for loading Content-Type: message/rfc822 attachments.

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

attachmentId

Number

*

The attachment ID

Response

If successful, the response will contain an instance of mail.

Source

Get

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Response

The raw email source.

Download

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Response

The raw email in message/rfc822 format (eml) – served using Content-Disposition: attachment in the response header.

Get Headers

URL parameters

Name

Type

Required

Values

Description

mailId

String

*


The mail ID

Response

The raw email source headers.

Labels

Add

URL parameters

Name

Type

Required

Values

Description

mailId

String

*

The mail ID

Request body (JSON)

Name

Type

Required

Values

Description

labelId

String

*

The label ID

Response

If successful, the response will be empty.

Remove

URL parameters

Name

Type

Required

Values

Description

mailId

String

*

The mail ID

labelId

String

*

The label ID

Response

If successful, the response will be empty.

Spam Marker

Starting with version 10.5.25.

Mark as Spam

URL parameters

Name

Type

Required

Values

Description

mailId

String

*

The mail ID

Response

If successful, the response will contain an instance of mail.

Mark as Not Spam

URL parameters

Name

Type

Required

Values

Description

mailId

String

*

The mail ID

Request body (JSON)

Name

Type

Required

Values

Description

destinationFolderId

String

Default value: Inbox folder ID

The destination folder ID

Response

If successful, the response will contain an instance of mail.