Valid fields while Inserting a contact using google shared contact api using python

343 Views Asked by At

trying to add a contact below is sample code from api where can i get all the valid fields like organization etc and some sample python code for that?

new_contact = gdata.contacts.ContactEntry(title=atom.Title(text=name))
new_contact.content = atom.Content(text=notes)
# Create a work email address for the contact and use as primary.
new_contact.email.append(gdata.contacts.Email(address=primary_email,
    primary='true', rel=gdata.contacts.REL_WORK))
# Add extended properties to add data which is used in your application.
new_contact.extended_property.append(gdata.ExtendedProperty(
    name='favourite flower', value='daisy'))
sports_property = gdata.ExtendedProperty(name='sports')
sports_property.SetXmlBlob('<dance><salsa/><ballroom_dancing/></dance>')
new_contact.extended_property.append(sports_property)

# Send the contact data to the server.
contact_entry = gd_client.CreateContact(new_contact)
1

There are 1 best solutions below

1
On

There's a pretty full list of attributes in the gdata-python-client source code (see the PersonEntry and ContactEntry classes) and some example code for using the client as well.