Gmail Gets A Restful API
Written by Ian Elliot   
Tuesday, 01 July 2014

Why exactly does Gmail need an a Restful API? Isn't IMAP or POP3 enough? 

Google has announced another way to get your email from Gmail. The new Gmail API is a Restful API that, obviously, can be used in any language that supports HTTP which is, equally obviously, most of them.

 

googledevs

You can already interact with Gmail using IMAP and POP3 so why do you need an additional API? What is more you can even script Gmail using App Script to automate many Gmail tasks.

The new API is in fact a lot like the App Script document model. You can read, send and delete email using it and you can interact with email using the thread structure and labels. You have to make use of OAuth 2 to authenticate and you have to ask for a particular permission level - full access, read, modify and compose. 

Emails are sent in base64 encoded form and this makes things a little more complicated when you are reading or composing a new email. ??However, there are client libraries that cover up the fact that you are using a Restful API for most popular languages - Java, .NET, JavaScript, Objective-C, PHP, and Python. There are also early alpha libraries for Go, Node.js and Ruby. 

So why a new API?

According to the Apps Developer Blog:

"In contrast to IMAP, which requires access to all of a user’s messages for all operations, the new API gives fine-grained control to a user’s mailbox. For example, if your app only needs to send mail on behalf of a user and does not need to read mail, you can limit your permission request to send-only.

To keep in sync, the API allows you to query the inbox change history, thereby avoiding the need to do “archaeology” to figure out what changed."

You can also discover Google's viewpoint in the following video: 

 

All very reasonable and the RESTful approach is also claimed to be faster than IMAP. 

If you are thinking of writing an app that works with Gmail then there is no question that the new API is the way to go but... 

You need to keep in mind that the Gmail API is just that - a Gmail API. If you create an app that uses IMAP then it should work with any mailbox that is IMAP enabled, i.e. most. If you choose to work with the Gmail API then you are locked into Gmail. What is more, if a user wants your app then they better have a Gmail account. 

Could this have been at least part of the motivation for the new API?  Replacing a standard API by a proprietary one is in Google's best interests, but to be fair IMAP is still supported. 

googledevsicon

 

 

 

Banner


Feminist Hacker Barbie?
26/11/2014

Can you see Barbie as a computer engineer? No, apparently nor can Mattel, though the online community is giving a much more accurate and amusing view of how things would work out under the hashtag #fe [ ... ]



The Deep Flaw In All Neural Networks
10/12/2014

Recently a paper reported the information that neural networks seem to have a fundamental problem in recognizing things now we have another twist on the same basic idea. In this case you can construct [ ... ]


More News

 

blog comments powered by Disqus

Last Updated ( Tuesday, 01 July 2014 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.