Google Contacts Error: If-Match or If-None-Match header or entry etag attribute required

Posted by Ali on Stack Overflow See other posts from Stack Overflow or by Ali
Published on 2010-06-12T09:39:46Z Indexed on 2010/06/12 9:42 UTC
Read the original article Hit count: 457

Hi guys I'm following the example code as defined on this website: http://www.ibm.com/developerworks/opensource/library/x-phpgooglecontact/index.html

I want to be able to integrate with my google apps account and play around with teh contacts. However I get this error whenever I try to run the modify contacts code:

If-Match or If-None-Match header or entry etag attribute required

This is my code:

Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_Query');
Zend_Loader::loadClass('Zend_Gdata_Feed');

$client = getGoogleClient('cp'); // this is a function I made - its working fine
$client->setHeaders('If-Match: *');

$gdata = new Zend_Gdata($client);
$gdata->setMajorProtocolVersion(3);
$query = new Zend_Gdata_Query($id);// id is the google reference 

$entry = $gdata->getEntry($query);
$xml = simplexml_load_string($entry->getXML());

$xml->name->fullName = trim($contact->first_name).' '.trim($contact->last_name);

$entryResult = $gdata->updateEntry($xml->saveXML(), $id);

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework