David Thielen
David Thielen

Reputation: 33026

Is there an API to the GMail server?

I know there's an API for a Gmail plugin in your browser. Is there one for the server? For example, if I want to write an anti-virus app that reads emails coming in to an account on the server, then let's them continue or quarantines them - all before the user ever sees them?

Obviously it would have to be authorized for the users it did this for.

Upvotes: 1

Views: 223

Answers (2)

kasoban
kasoban

Reputation: 2167

EDIT: As of 26/06/2014, this answer has become incorrect, as Google just released a dedicated API to GMail. See the link in this post for reference.

Original answer below this line :


From a technological perspective, it's a mail server just like any other.

Thus, your choice should fall on a mail protocol. It's also already answered in the question you linked: https://stackoverflow.com/a/2820280/1680196

Your app would open an IMAP connection to your mail server of choice (in this case gmail), scan for incoming mail, read the content and trigger a delete / move to trash if necessary.

Personally, I wouldn't trust any app like this running outside my own mailserver / mail client, since this use case requires full read and write access to a users mails.

There might be some API for Google Apps for Domains mail accounts, but I doubt this goes beyond the RSS mail notifications.

Edit: Official Google api documentation also refers to IMAP for accessing user inboxes. Link to IMAP OAuth overview. With application specific passwords users could enable your app to access their account without exposing their actual credentials, but beyond that I fear you are out of luck.

Upvotes: 1

Eric D
Eric D

Reputation: 7159

There is an HTTP REST API now! http://developers.google.com/gmail/api/ (And has been for years if you were willing to use IMAP. :-D)

Upvotes: 1

Related Questions