List methods:GET
Instance methods:GET
| name | type | description |
|---|---|---|
| optional: | ||
| subject | string | Get threads with messages whose subject matches this search string. To use regular expressions instead of simple string matching, make sure the string starts and ends with /. |
| string | Email address of the contact for whom you want the latest threads. This value is interpreted as received from email X, sent to email X or sent by anyone to both email X and the source owner. | |
| to | string | Get threads with at least one message sent to this email address. |
| from | string | Get threads with at least one message sent from this email address. |
| cc | string | Get threads with at least one message having this email address CC'ed. |
| bcc | string | Get threads with at least one message having this email address BCC'ed. |
| folder | string | Filter threads by the folder (or Gmail label). This parameter can be the complete folder name with the appropriate hierarchy delimiter for the mail server being queried (eg. Inbox/My folder) or the "symbolic name" of the folder (eg. \Starred). The symbolic name refers to attributes used to refer to special use folders in a language-independant way. See http://code.google.com/apis/gmail/imap/#xlist (Gmail specific) and RFC-6154. |
| indexed_before | integer (unix time) | Get threads with at least one message indexed before this timestamp. This is not the same as the date of the email, it is the time Context.IO indexed this message. |
| indexed_after | integer (unix time) | Get threads with at least one message indexed after this timestamp. This is not the same as the date of the email, it is the time Context.IO indexed this message. |
| active_before | integer (unix time) | Get threads with at least one message dated before this timestamp. The value this filter is applied to is the Date: header of the message which refers to the time the message is sent from the origin. |
| active_after | integer (unix time) | Get threads with at least one message dated after this timestamp. The value this filter is applied to is the Date: header of the message which refers to the time the message is sent from the origin. |
| started_before | integer (unix time) | Get threads whose first message is dated before this timestamp. The value this filter is applied to is the Date: header of the message which refers to the time the message is sent from the origin. |
| started_after | integer (unix time) | Get threads whose first message is dated after this timestamp. The value this filter is applied to is the Date: header of the message which refers to the time the message is sent from the origin. |
| limit | integer | The maximum number of results to return. |
| offset | integer | Start the list at this offset (zero-based). |
[ stringComplete URL of a thread this contact is in, ... ]
The purpose of this call is to allow Gmail extensions to easily retrieve data when users's load a conversation in the Gmail UI. Hence, threads are identified by the value of their Gmail thread prefixed with "gm-".
gmail_thread_id prefixed with gm-For example, if the URL of a conversation in the Gmail UI is https://mail.google.com/mail/u/0/#mbox/13119ab37f00b826, you would obtain the details about this thread by calling:
GET https://api.context.io/2.0/accounts/<accountId>/threads/gm-13119ab37f00b826
| name | type | description |
|---|---|---|
| optional: | ||
| include_body | integer | Set to 1 to include message bodies in the result. Since message bodies must be retrieved from the IMAP server, expect a performance hit when setting this parameter. |
| include_headers | mixed | Can be set to 0 (default), 1 or raw. If set to 1, complete message headers, parsed into an array, are included in the results. If set to raw, the headers are also included but as a raw unparsed string. Since full original headers bodies must be retrieved from the IMAP server, expect a performance hit when setting this parameter. |
| include_flags | integer | Set to 1 to include IMAP flags of messages in the result. Since message flags must be retrieved from the IMAP server, expect a performance hit when setting this parameter. |
| body_type | string | Used when include_body is set to get only body parts of a given MIME-type (for example text/html) |
| limit | integer | The maximum number of messages to include in the messages property of the response. |
| offset | integer | Start the list of messages at this offset (zero-based). |
You can retrieve thread information for any message using the Thread resource of that message.
{
"gmail_thread_id": stringThread id assigned by Gmail (only present if source is a Gmail account),
"email_message_ids": arrayList of email_message_ids forming the thread,
"person_info": objectAdditional info about contacts on this message (more details),
"messages": [
{
"date": numberUnix timestamp of message date,
"date_indexed": numberTime this message was first seen by Context.IO (unix timestamp),
"addresses": objectEmail addresses and names of sender and recipients (more details),
"person_info": objectAdditional info about contacts on this message (more details),
"email_message_id": stringValue of RFC-822 Message-ID header,
"message_id": stringUnique and persistent id assigned by Context.IO to the message,
"gmail_message_id": stringMessage id assigned by Gmail (only present if source is a Gmail account),
"gmail_thread_id": stringThread id assigned by Gmail (only present if source is a Gmail account),
"files": [
{
"size": numberSize of the attachment in bytes,
"type": stringValue of Content-type header for the attachment,
"file_name": stringFull name of the file attached,
"file_name_structure": arrayName of the file broken down in semantic parts (more details),
"body_section": numberIdentifies MIME body part the attachment can be found in,
"file_id": stringUnique and persistent id assigned by Context.IO to the file,
"is_embedded": booleanIndicates whether this file is an object embedded in the message or not,
"content_disposition": stringValue of the Content-Disposition header of the MIME part containing this file, if specified. Typically 'inline' or 'attachment',
"content_id": stringIf this file is an embedded object, this is the value of the Content-Id header of the MIME part containing this file
},
...
],
"subject": stringSubject of the message,
"folders": arrayList of folders (or Gmail labels) this message is found in,
"sources": [
{
"label": stringLabel of the source containing this message,
"resource_url": stringComplete URL of the source
},
...
]
},
...
]
}