Specifying custom fields for contacts in Google Contacts API v3
问题 How do I specify custom fields while creating/updating a contact with the API (also retrieving it)? I'm using the Python API. 回答1: import gdata.contacts.data new_contact = gdata.contacts.data.ContactEntry() # Set the contact's name. new_contact.name = gdata.data.Name( given_name=gdata.data.GivenName(text='Elizabeth'), family_name=gdata.data.FamilyName(text='Bennet'), full_name=gdata.data.FullName(text='Elizabeth Bennet') ) # Set user defined fields new_contact.user_defined_field.append( gdata