accounts/files

Supported methods

List methods:GET

Instance methods:GET

Sub-resources

content related

Files list

GET: Listings of files found as email attachments

GET https://api.context.io/2.0/accounts/id/filestest it
idUnique id of an account accessible through your API key

List filters

Each of the email, to, from, cc and bcc parameters can be set to a comma-separated list of email addresses. These multiple addresses are treated as an OR combination.

You can set more than one parameter when doing this call. Multiple parameters are treated as an AND combination.

nametypedescription
optional:
file_namestringSearch for files based on their name. You can filter names using typical shell wildcards such as *, ? and [] or regular expressions by enclosing the search expression in a leading / and trailing /. For example, *.pdf would give you all PDF files while /\.jpe?g$/ would return all files whose name ends with .jpg or .jpeg
file_size_minintegerSearch for files based on their size (in bytes).
file_size_maxintegerSearch for files based on their size (in bytes).
emailstringEmail address of the contact for whom you want the latest files exchanged with. By "exchanged with contact X" we mean any email received from contact X, sent to contact X or sent by anyone to both contact X and the source owner.
tostringEmail address of a contact files have been sent to.
fromstringEmail address of a contact files have been received from.
ccstringEmail address of a contact CC'ed on the messages.
bccstringEmail address of a contact BCC'ed on the messages.
date_beforeinteger
(Unix timestamp)
Only include files attached to messages sent before a given 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.
date_afterinteger
(Unix timestamp)
Only include files attached to messages sent after a given 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.
indexed_beforeinteger
(Unix timestamp)
Only include files attached to messages indexed before a given timestamp. This is not the same as the date of the email, it is the time Context.IO indexed this message.
indexed_afterinteger
(Unix timestamp)
Only include files attached to messages indexed after a given timestamp. This is not the same as the date of the email, it is the time Context.IO indexed this message.
sourcestringFilter messages by the account source label.
sort_orderstringThe sort order of the returned results. Possible values are asc and desc
limitintegerThe maximum number of results to return. The maximum limit is 100.
offsetintegerStart the list at this offset (zero-based).

Response body

[
  {
    "size": numberSize of file in bytes.,
    "type": stringMIME type as specified in message source,
    "subject": stringSubject line of message this file is attached to,
    "date": numberUnix timestamp of the message,
    "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 the message (more details),
    "file_name": stringName of file,
    "file_name_structure": arrayName of the file broken down in semantic parts (more details),
    "body_section": stringMIME section this file can be found in (useful only if you're parsing raw source),
    "file_id": stringUnique and persistent id for this file,
    "supports_preview": booleanwhether or not the file supports our preview function,
    "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,
    "message_id": stringContext.IO id of the message this file is attached to,
    "email_message_id": stringValue of RFC-822 Message-ID header this file is attached to,
    "gmail_message_id": stringGmail message id the file is attached to (only present if source is a Gmail account),
    "gmail_thread_id": stringGmail thread id the file is attached to (only present if source is a Gmail account)
  },
  ...
]

File instance

GET: Details for a given file

GET https://api.context.io/2.0/accounts/id/files/file_idtest it
idUnique id of an account accessible through your API key
file_idUnique id of a file

Response body

{
  "size": numberSize of file in bytes.,
  "type": stringMIME type as specified in message source,
  "subject": stringSubject line of message this file is attached to,
  "date": numberUnix timestamp of the message,
  "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 the message (more details),
  "file_name": stringName of file,
  "file_name_structure": arrayName of the file broken down in semantic parts (more details),
  "body_section": stringMIME section this file can be found in (useful only if you're parsing raw source),
  "file_id": stringUnique and persistent id for this file,
  "supports_preview": booleanwhether or not the file supports our preview function,
  "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,
  "message_id": stringContext.IO id of the message this file is attached to,
  "email_message_id": stringValue of RFC-822 Message-ID header this file is attached to,
  "gmail_message_id": stringGmail message id the file is attached to (only present if source is a Gmail account),
  "gmail_thread_id": stringGmail thread id the file is attached to (only present if source is a Gmail account)
}