add Organization via Python client library

96 views
Skip to first unread message

PC

unread,
Mar 11, 2012, 1:34:28 PM3/11/12
to google-co...@googlegroups.com
Hello

I am trying to add contact information via the Python client library.
The following code runs but the data does not show up in the UI for that contact.
Also in the UI the Job Title / Company field under the contact name are no longer selectable. There is just whitespace.
What am I doing wrong here?

# Set Title and Organization
new_contact.organization = gdata.data.Organization(
  label='Work',
  primary='true', 
  org_name=gdata.data.OrgName(text='Google'),
  org_title=gdata.data.OrgTitle(text='Software Tester'))

Alasdair North

unread,
Apr 6, 2012, 9:33:54 AM4/6/12
to Google Contacts, Shared Contacts and User Profiles APIs
I believe this is what you're looking for:

new_contact.organization = gdata.data.Organization(
label='Work',
primary='true',
name=gdata.data.OrgName(text='Google'),
title=gdata.data.OrgTitle(text='Software Tester')
)

Although the online documentation for the Contacts API is pretty
sparse, the pydoc stuff is quite helpful. To find out all you needed
for the above you just need to type the following into a python
terminal:

import gdata.data
help(gdata.data.Organization)
Reply all
Reply to author
Forward
0 new messages