3 messages in com.googlegroups.google-base-data-apiRe: 400 error while updating items
FromSent OnAttachments
reds...@googlemail.com11 Dec 2007 02:00 
Jeff S12 Dec 2007 17:43 
reds...@googlemail.com12 Dec 2007 23:31 
Subject:Re: 400 error while updating items
From:reds...@googlemail.com (reds@googlemail.com)
Date:12/12/2007 11:31:53 PM
List:com.googlegroups.google-base-data-api

Hi Scudder,

Thanks a lot for your effort and posting the error , additionally i discovered from the group that even if you upadate you have to post all your data fields in XML , hence we got the error for missing feild .

This is resolved now . thx

On Dec 13, 6:43 am, Jeff S <j.@google.com> wrote:

Hello,

I used half of your PHP script to try to reproduce this, I just generated the XML but I did an insert instead of an update since I don't have access to your items. When I tried to insert the XML, I saw two errors come back with the HTTP 400 response. The HTTP body was:

<errors> <error type="data" field="title" reason="A title is required." /> <error type="data" field="item" reason="Cannot exceed 30 days" /> </errors>

Are you seeing the same?

Thank you,

Scudder

On Dec 11, 2:00 am, "reds@googlemail.com"

<reds@googlemail.com> wrote:

hi , i am getting CURL error The requested URL returned error: 400 while updating item on the Current google base feeds , i have cut short my Atom feed to minimum like below

$items_array = "<?xml version='1.0'?>" . "\n"; $items_array .= "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:g='http://base.google.com/ns/1.0'>" . "\n"; $items_array .= "<category scheme='http://base.google.com/categories/ itemtypes' term='Products'/>" . "\n"; $items_array .= "<g:item_type>products</g:item_type>" . "\n"; $items_array .= "<author>" . "\n"; $items_array .= "<name>Redstore.com</name>" . "\n"; $items_array .= "<email>i.@redstore.com</email>" . "\n"; $items_array .= "</author>" . "\n"; $items_array .= "<title>".$title."</title>" . "\n"; $items_array .= "<g:price>2,625.90</g:price>" . "\n"; $items_array .= "<g:quantity>10</g:quantity>" . "\n"; $items_array .= "<g:expiration_date type='dateTime'>2008-01-19T07:23:33Z</g:expiration_date>" . "\n"; $items_array .= "</entry>" . "\n";

and CURL as

$ch = curl_init(); /* Create a CURL handle. */ /* Prepare the data for HTTP PUT. */ $putString = $items_array; $putData = tmpfile(); fwrite($putData, $putString); fseek($putData, 0);

/* Set cURL options. */ curl_setopt($ch, CURLOPT_URL, $gid); curl_setopt($ch, CURLOPT_PUT, true); curl_setopt($ch, CURLOPT_INFILE, $putData); curl_setopt($ch, CURLOPT_INFILESIZE, strlen($putString)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: AuthSub token="' . $token . '"', 'X-Google-Key: key=' . $developerKey, 'Content-Type: application/atom+xml' ));

$result = curl_exec($ch); /* Execute the HTTP request. */

$er_msg=curl_error ($ch ); echo $er_msg;

fclose($putData); /* Close and delete the temp file. */ curl_close($ch); /* Close the cURL handle. */

I dont know what's wrong with submission .