Get Even More from Email with our New API Features


It’s been just over four months since Context.IO 2.0 came out of beta, and since then, we’ve received a ton of great feedback. Over the past 2 to 3 months, we’ve been rolling out enhancements based on that feedback and wanted to give you a quick summary of what’s new. Changes include:

Better control over folders
– For apps that require the most up-to-date mailbox data, we’ve added direct access to IMAP servers for certain calls.
– The ability to create time-limited direct links to attachments
Creating an account and a source in a single call, saving time and making error handling easier
– Getting the
raw list of attachments for messages
Pull the bodies, flags and headers for your messages in a single call
Total number of messages and files now exposed when adding a new account.

Here’s a bit more info about each addition we’ve made:

New Folders Resource

While the list of folders is part of the metadata returned for messages, this resource gives you better control of those. The GET method will give you a list of folders a specific message is listed under, POST will let you add or remove folders and PUT allows you to overwrite the list of folders a message is in with a new set.

This can be great for productivity apps that are building task lists based on messages in specific folders, and once done, posting the completed task to a new folder. It can also be used to move messages with attachments into a specific folder, to sync with a third party storage tool, as in the case of emailtobox.com.

See docs for more details: http://context.io/docs/2.0/accounts/messages/folders

Back to top

Fetching Messages Straight from the Server

While you can already pull message data with the messages resource, we added a way to pull a list of messages straight from the IMAP server. Before responding, this call checks the IMAP server directly for any new messages and will add them to the response. This way, your list of messages reflects exactly whats on the IMAP server the moment the call is made versus the last time Context.IO synced with it.

For any apps that require the most up-to-date list of messages from a specific folder as possible and can tolerate the performance hit caused by connecting to the IMAP server, this call is for you.

See docs for more details: http://context.io/docs/2.0/accounts/sources/folders/messages

Back to top

Deep Links to Individual Attachments from your App

Letting users download individual attachments from your app involved that attachment going through your server before you send it back to the browser. To skip that hop, you can now generate a time-limited link to an attachment and redirect the user to that link.

See docs for more details: http://context.io/docs/2.0/accounts/files/content#get

Back to top

Create an Account and a Source in a Single Call

Use this call to not only create an account and a source in a single call, but to ease up any error handling: if the source parameters aren’t valid or don’t map to an existing and accessible mailbox, the account isn’t created and the call returns an error code.

See docs for more details: http://context.io/docs/2.0/accounts#post

Back to top

Get the Raw Attachments List

We automatically filter out files like signature images or winmail.dat files from the files list. If you need the raw list of files and that filtering is causing you more trouble than anything else, you can now turn it off by setting the raw_file_list parameter to 1 when creating sources.

See docs for more details: http://context.io/docs/2.0/accounts/sources#post

Back to top

Callback Notification when the Initial Indexing is Complete

Find out when your apps’ mailboxes are ready to go! When you add a source, you can now specify a callback URL and we’ll make a POST request to it when the initial sync is complete.

See docs for more details: http://context.io/docs/2.0/accounts/sources#post

Back to top

Get the Body, Flags and Headers of a Message in a Single Call

Message bodies, flags and headers are all available as separate resources that used to require separate API calls each requiring IMAP connections and the related overhead. You can now set any combination of include_body, include_flags and include_headers to 1 as GET parameters to obtain that data in a single call to a message instance.

See docs for more details: http://context.io/docs/2.0/accounts/messages#id-get

Back to top

Obtain Up-to-date Count of Unread Messages in Folders

Use the optional include_extended_counts paramater to pull the number of unread messages for a specific folder directly from the IMAP server, giving your app the most up to date information.

See docs for more details: http://context.io/docs/2.0/accounts/sources/folders#get

Number of Messages and Files Now Exposed as Property of an Account

When listing properties of an account, we now include the total number of messages and files contained within the account, by default. This allows you to do cool things like sort mailboxes by size!

See docs for more details: http://context.io/docs/2.0/accounts#get

Back to top

We’re always looking for ways to optimize access to rich email data and make it easier for developers to build killer apps on top of it. What do you think about these new calls and API changes? What are some of the ways they’ll improve your app, or do they give you any new ideas for apps you didn’t think were possible before?