I've several scripts for updating the pix of a contact. Below is the one I 
use. It works just fine. However, it works only when the contact already 
has a pix stored. 
Do you have another script for adding a pix, and not replacing one? or do 
you know what to modify to mine?
Thanks so much for your help.



$client = Zend_Gdata_ClientLogin::getHttpClient(USER,PASS, 'cp');
$gdata = new Zend_Gdata($client, 'Lcf');
$gdata->setMajorProtocolVersion(2);

$entryLink = 
'http://www.google.com/m8/feeds/contacts/****%40gmail.com/full/40...d1';
$photoLinkRel = 'http://schemas.google.com/contacts/2008/rel#photo';

$entry = $gdata->getEntry($entryLink);
$photoLink= $entry->getLink($photoLinkRel)->getHref();
$photoResponse = $gdata->get($photoLink); 
$newPhotoContent = file_get_contents($pix);
$gdata->put( $newPhotoContent, $photoLink, null, 'image/*', 
array('If-Match' => $photoResponse->getHeader('ETag'))  );

-- 
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
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to