Updating a Contact's Notes field (php)

368 views
Skip to first unread message

matt_jad

unread,
Dec 14, 2011, 7:47:01 AM12/14/11
to google-co...@googlegroups.com
I am using Zend to write a php script to sync our database with our gmail contacts.
All has been going well. I noticed however that using the xml that is sent via

$gdata = new Zend_Gdata($client);
$gdata->setMajorProtocolVersion(3);
$entry = $gdata->getEntry($query);
$xml = simplexml_load_string($entry->getXML());

If I want update a contacts using the xml, it does not have capabilities to update the "Notes" about the contact, which is a field in gmail. (a var_dump of $xml shows everything is available except the notes of the contact. Is there another way I can do it?

As an aside I also noticed that the contact details are sent as an array of phone/fax numbers with no way of identifying them, other than by which element in the array they exist in. If Google ever changes the order in which they occur it will result in our database containing incorrectly matched data. Any way I can check what field each phone-number is associated to.

Thanks in advance.

Alain Vongsouvanh

unread,
Dec 15, 2011, 4:51:47 PM12/15/11
to google-co...@googlegroups.com
Hello,

To update a contact's notes field in GMail using the API, simply update the contact's "content" element:

For phone numbers, here a list of the field available:
  http://code.google.com/apis/gdata/docs/2.0/elements.html#gdPhoneNumber

Usually, when a phone number is updated, the "rel" or "label" attribute will reflect what has been set in the UI. It is up to the application reading those to store them appropriately.

Best,
Alain


--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
google-co...@googlegroups.com
To unsubscribe from this group, send email to
google-contacts...@googlegroups.com
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html



--
Alain Vongsouvanh | Developer Programs Engineer
Reply all
Reply to author
Forward
0 new messages