My Wish for Google I/O 2015: A New Gmail API

I am looking forward to seeing what Google will announce at its I/O conference next week. My biggest wish is for a new Gmail API.

Last year, Google announced its first Gmail API. POP, IMAP, and even some Gmail-specific IMAP extensions had been available, but this was the first HTTP-based API for Gmail. It is a start, but it has some weaknesses.

The data returned when retrieving a list of objects from the Gmail API is minimal. If you request a list of messages, the response will contain only the Message ID and Thread ID of each message. If you want the subject of each message, you need to issue a separate “get” request for each message.

You can batch these “get” requests. The mechanism for batching requests is to send multiple requests in a batch request. A batch request is made up of multiple requests combined into a “multipart/mixed” HTTP request body. Each request in the batch includes its own set of HTTP headers. The response is a “multipart/mixed” response containing a full HTTP response for each batched request. The end result is that retrieving the message subjects for the newest 100 messages in your inbox requires two HTTP requests. The second request and second response will be bloated with the HTTP headers and MIME part separators for each request and response in the batch.

The Gmail API also has no mechanism for retrieving or modifying Gmail filters. Neither the Gmail iOS app nor the Gmail mobile web app allow the user to view or set filters. I can appreciate why Google would keep the mobile interfaces simple, but I wish Google would let a third party developer build an iOS app to manage Gmail filters.

Late last year, FastMail announced JMAP. JMAP is a proposed standard protocol for synchronizing a mail client with a mail server. JMAP supports the concept of messages being associated with more than one mailbox, just as Gmail messages can be associated with more than one label. Its approach to batching requests and responses requires less overhead. JMAP support is not yet available from any email provider – not even FastMail, but I hope to see that change. Like the Gmail API, JMAP does nothing for filters.

I would like to see Google either adopt JMAP or use some of the ideas behind JMAP to improve the Gmail API. I would also like to see an API that supported retrieving and updating filters.