If you fetch the user s contacts feed, you can access the authors
field which gives you email and name. Additionally, the feed s id
field appears to be the email address of the person who owns the contacts.
An example (in Scala) with names changed, assuming the user of AuthSub (sorry, I ve not migrated my code to OAuth) where you already have a session token
:
scala> val contacts_service = new ContactsService("foo")
contacts_service: com.google.gdata.client.contacts.ContactsService = com.google.gdata.client.contacts.ContactsService@3fd1acee
scala> contacts_service.setAuthSubToken(token, null)
scala> val feedUrl = new URL("https://www.google.com/m8/feeds/contacts/default/full?max-results=10000")
feedUrl: java.net.URL = https://www.google.com/m8/feeds/contacts/default/full?max-results=10000
scala> val feed = contacts_service.getFeed(feedUrl, classOf[ContactFeed])
feed: com.google.gdata.data.contacts.ContactFeed = {ContactFeed com.google.gdata.data.contacts.ContactFeed@271a95f8}
scala> feed.getId
res13: java.lang.String = user@example.com
scala> val p = feed.getAuthors.head
p: com.google.gdata.data.Person = com.google.gdata.data.Person@513b4686
scala> p.getEmail
res14: java.lang.String = user@example.com
scala> p.getName
res15: java.lang.String = Example User