I am trying to retrieve all the contacts from my Gmail account. At the moment it only seems to randomly get about 25 (I have about 200 contacts in the My Contacts group). What I have noticed is that these contacts that are retrieved are all old contacts that I made a long time ago. The newer contacts don't seem to show.
OAuth2Token
token = gdata.gauth.OAuth2Token(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, scope=SCOPE, user_agent=USER_AGENT) redirect_url = token.generate_authorize_url(redirect_uri=REDIRECT_URI)
Redirect for Auth
self.redirect(redirect_url)
Auth, Get Contacts and Display
url = atom.http_core.Uri.parse_uri(self.request.uri) if 'error' in url.query: pass else: token.get_access_token(url.query) gd_client = gdata.contacts.client.ContactsClient() token.authorize(gd_client) feed = gd_client.GetContacts() for i, entry in enumerate(feed.entry): self.response.write(entry.name.full_name)
In the Developer Contacts Page the 'Running the sample code' says to use:
gd_client = gdata.contacts.data.ContactsClient(source='YOUR_APPLICATION_NAME')
But it keeps kicking out an error that the ContactsClient was not found. I eventually found it in gdata.contacts.client
.
Additional question - I have assigned USER_AGENT
with '', what am I supposed to put there?