Frage

I would like to access Gmail's native API. Eg,

  • create a search folder
  • tag messages
  • other gmail-specific actions.

There's this similar question, however the question asker seems happy with developing contextual gadgets rather than actually accessing a user's email.

In before anyone mentions: IMAP and POP are generic, non search based protocols and do not provide full access to gmail. Neither gmail.com, nor any of the official Gmail native apps, use IMAP and POP.

Most webmail services have private, non-IMAP/POP APIs and protocols, eg, hotmail (back when it existed used HTTPMail which was reverse engineered and implemented by hotwayd).

I could run Android gmail with a proxy and attempt to reverse engineer the Gmail protocol itself, but I suspect others have had the same need in the past and may already have a solution.

I did find a list of client of Gmail clients on Gmail Agent API but they don't seem maintained past 2004.

War es hilfreich?

Lösung 2

Update June 2014: Google have announced access to the native gmail API.

The Gmail API gives you flexible, RESTful access to the user's inbox, with a natural interface to Threads, Messages, Labels, Drafts, and History. From the modern language of your choice, your app can use the API to add Gmail features like:

  • Read messages from Gmail

  • Send email messages

  • Modify the labels applied to messages and threads

  • Search for specific messages and threads

https://developers.google.com/gmail/api/

Andere Tipps

Android's Gmail app is using Google Cloud Messaging (GCM) to push email messages/notifications and sync with the phone. I think that’s “the API” you are looking for. The bad news is that it is obviously very well protected.

You can get started for free with GCM's JSON REST API and use it for your push messaging projects, but forget about using it for your Gmail in the same fashion Google does. The only option for getting a similar efficiency would be using IMAP's IDLE extension, which uses also push.


Focusing on what you need, I think there are decent solutions for the use cases you have listed in your question… You could use a [**Google App Script**][4] or libs like [**GMail for Python**][5], which seems a valid option to me... from the [**GMail for Python GitHub**][6]:

Features

  • Search emails
  • Read emails
  • Emails: label, archive, delete, mark as read/unread/spam, star
  • Manage labels

If you are developing an Android mobile app Gmail Public Labels API could also be of your interest...

Hope it helps...


EDIT: Google just introduced its GMAIL API

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top