views:

164

answers:

0

Hi guys I'm trying to update my google contacts using the zend framework but I'm getting the following error:

Expected response code 200, got 403 If-Match or If-None-Match header or entry etag attribute required

The following 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);

Whats going on?