Message

Get message information

Returns details of a specific message. By default text content is not included, use textType value to force retrieving text

get/v1/account/{account}/message/{message}

Request

  • Base URL: https://your-emailengine-host
  • URL: https://your-emailengine-host/v1/account/{account}/message/{message}
  • Auth: HTTP bearer

Path parameters

accountstring required

Unique identifier for the email account

Example:user123
messagestring required

Message ID

Example:AAAAAQAACnA

Query parameters

maxBytesinteger

Max length of text content

Example:5248000
textType'html' | 'plain' | '*'

Which text content to return, use * for all. By default text content is not returned.

Example:*
webSafeHtmlboolean

Shorthand option to fetch and preprocess HTML and inline images

embedAttachedImagesboolean

If true, then fetches attached images and embeds these in the HTML as data URIs. Not set means false

preProcessHtmlboolean

If true, then pre-processes HTML for compatibility

markAsSeenboolean

If true, then marks unseen email as seen while returning the message

Headers

x-ee-timeoutinteger

Request timeout in milliseconds. Raises the command timeout above the EENGINE_TIMEOUT default for a long-running request; a value below the default has no effect

Example:30000

Response

Returns the message envelope and structure. Text content is only included when requested.

idstring

EmailEngine message identifier

uidinteger

IMAP UID (unique identifier within the mailbox). IMAP accounts only

emailIdstring

Globally unique email identifier (when supported by the email server)

threadIdstring

Thread identifier for email conversations (when supported by the email server)

pathstring

Mailbox folder path that contains this message. Not returned for Gmail API accounts

datestring date-time

Date when the message was received by the mail server

draftboolean

Whether this message is a draft

unseenboolean

Whether this message is unread

flaggedboolean

Whether this message is flagged/starred

answeredboolean

Whether this message has been answered (IMAP accounts only)

sizeinteger

Message size in bytes. Not returned for MS Graph API accounts

subjectstring

Message subject line

messageIdstring

Message-ID header value

inReplyTostring

Message-ID of the message this is replying to

flagsstring[]

IMAP flags set on this message

labelsstring[]

Gmail labels applied to this message

headersMessageHeaders

Raw email headers as key-value pairs (arrays contain multiple values for headers that appear multiple times)

isAutoReplyboolean

Whether this message appears to be an automatic reply (out of office, vacation responder, etc.)

isBounceboolean

Whether this message is a bounce (a delivery failure report). Checked for messages in the Inbox only; a delivery or delay notification is not one

relatedMessageIdstring

Message-ID of the message that bounced. Set together with isBounce

previewstring

Short preview of the message content (Gmail API and MS Graph API accounts only)

category'primary' | 'social' | 'promotions' | 'updates' | 'forums'

Gmail inbox tab/category of the message (Gmail API accounts only)

specialUse'\All' | '\Archive' | '\Drafts' | '\Flagged' | '\Junk' | '\Sent' | '\Trash' | '\Inbox'

Special folder type of the mailbox containing this message (IMAP accounts only)

messageSpecialUse'\Drafts' | '\Junk' | '\Sent' | '\Trash' | '\Inbox'

Special folder type where this message is stored

Example response

{
  "id": "AAAAAgAACrI",
  "uid": 12345,
  "emailId": "1278455344230334865",
  "threadId": "1694936993596975454",
  "path": "INBOX",
  "date": "2021-03-22T13:13:31.000Z",
  "unseen": true,
  "flagged": true,
  "size": 1040,
  "subject": "What a wonderful message",
  "from": {
    "name": "From Me",
    "address": "sender@example.com"
  },
  "sender": {
    "name": "From Me",
    "address": "sender@example.com"
  },
  "to": [
    {
      "name": "Some Name",
      "address": "user@example.com"
    }
  ],
  "cc": [
    {
      "name": "Some Name",
      "address": "user@example.com"
    }
  ],
  "bcc": [
    {
      "name": "Some Name",
      "address": "user@example.com"
    }
  ],
  "replyTo": [
    {
      "name": "Some Name",
      "address": "user@example.com"
    }
  ],
  "messageId": "<test123@example.com>",
  "inReplyTo": "<7JBUMt0WOn+_==MOkaCOQ@mail.gmail.com>",
  "flags": [
    "\\Seen"
  ],
  "labels": [
    "\\Important"
  ],
  "attachments": [
    {
      "id": "AAAAAgAACrIyLjI",
      "contentType": "image/gif",
      "encodedSize": 48,
      "embedded": true,
      "inline": true,
      "contentId": "<unique-image-id@localhost>",
      "filename": "image.png",
      "method": "REQUEST"
    }
  ],
  "headers": {
    "from": [
      "From Me <sender@example.com>"
    ],
    "subject": [
      "What a wonderful message"
    ]
  },
  "text": {
    "id": "AAAAAgAACqiTkaExkaEykA",
    "encodedSize": {
      "plain": 1013,
      "html": 1013
    },
    "plain": "Hello from myself!",
    "html": "<p>Hello from myself!</p>",
    "webSafe": true
  },
  "relatedMessageId": "<original@example.com>",
  "preview": "Hello, here is the report you asked for",
  "category": "primary",
  "specialUse": "\\Sent",
  "messageSpecialUse": "\\Sent"
}

Changes

No recorded changes to this operation across all 1 revision of this API.