API version:
  • 1.0
  • 1.1
  • 2.0

accounts/messages/body

Supported methods

GET

GET: Fetch the message body of a given email

GET https://api.context.io/2.0/accounts/id/messages/message_id/bodytest it
idUnique id of an account accessible through your API key
message_idUnique id of a message. This can be the message_id or email_message_id property of the message. The gmail_message_id (prefixed with gm-) can also be used.
On-demand data retrieval

Since we do not keep full copies of emails on our servers, this call triggers a connection to the IMAP server to fetch the message. One thing to point out is we do fetch messages in such a way that large files attached to a message won't make any difference in the response time.

Parameters

nametypedescription
optional:
typestringMany emails are sent with both rich text and plain text versions in the message body and by default, the response of this call will include both. It is possible to only get either the plain or rich text version by setting the type parameter to text/plain or text/html respectively.

Response body

[
  {
    "type": stringMIME type of message part being fetched,
    "charset": stringencoding of the characters in the part of message,
    "content": stringthe actual content of the message part being pulled,
    "body_section": numberindicating position of the part in the body structure,
  }
]

If you want to fetch headers, body and flags for a given message, you can use the related include_* GET parameters on the message instance to get them all in a single call.

Retrieving attachments

This call only returns text portions of messages, attachments aren't included. To get a list of attachments on the message, look for the files property in the response of a message instance. To download the content of these attachments, use the files/content call