I am new to the Google API and am trying to write a PHP script to
update my products under my Merchant Centre account.  Tackle the easy
route first I tried the method described here
http://code.google.com/apis/base/docs/2.0/developers_guide_protocol.html#Authentication

Taking the example:
POST /accounts/ClientLogin HTTP/1.0
Content-type: application/x-www-form-urlencoded

accountType=HOSTED_OR_GOOGLE&email...@gmail.com&Passwd=nr23AZ&service=gbase&source=my-
app-name

and constructing a php script to do the POST using cURL gave me a
response of FALSE.

If it type the string for my account into the browser address as
follows:

https://www.google.com/accounts/ClientLogin?accountType=HOSTED_OR_GOOGLE&email=mymerchantacco...@gmail.com&Passwd=mypaswd&service=gbase

I get a page with the following:
SID=DQAAAKYAAADLqxzq2YxSnUWJgnC6nlIAOcX16EorhI2sfPCUtRyA54nzP-
odCgTq7_0WHW_W2EZliK1_Y9t7A-
f_bOcpYrrd42i_COYtIa86gEtDyJbdwmqx1HSRwWh1KW-
JOSQWCX49g94Npm4ufMTlwt0NYFF4oq-1W6uugKy00QzyeSdBO_AMRSG3bKbHu0OU2woMDz_6HHm1tJCECLysizD3yJF2SEW0V0F07zKZkczw4RuFCA
LSID=DQAAAKgAAABxjh6cDNswn3vCBAEmWLfLmaFGmDdM6HA4OA9QWwB0be3HMJ7-
b8vIAXi-oYSiF4rlTMncEboFIPiBvA7ULyZN33QEzOlMAQDmzUNtjgUnHEeXr3-
N5BBpr2VFliPDg5dPxJYTlwntLLJ6muIylVvpqPrKt3dMh1a4T-
U55VJodtkYNsIMsbLFS_vK3g_AWnre6IHawBWsZeDMY2i8vhNTIeJm2sg6XKmlFJ07IM1vHA
Auth=DQAAAKkAAABxjh6cDNswn3vCBAEmWLfLmaFGmDdM6HA4OA9QWwB0be3HMJ7-
b8vIAXi-oYSiF4rlTMncEboFIPiBvA7ULyZNXh-
C1vrRs-5bCqnJxm6OeOabwC8562BEEHV1bLbbdxjoqRK5RxDgCPKWbM2Vu7HMtQ4hstM-
Y9AdiaHqoDh6vK1eAc8IkIjMtLclhJxwCIMNmaCMoq3v1bknQxx_0aPYMrM6nzfWMXK0qA_OQLnDKg

So I tried using php's curl to do a get instead of a put:

<?php
$url = 'https://www.google.com/accounts/ClientLogin';
$url_query =
'accountType=HOSTED_OR_GOOGLE&email=mymerchantacco...@gmail.com&Passwd=mypaswd&service=gbase';
$curl_handle=curl_init($url . '?' . $url_query);
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION  ,1);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,true); // RETURN THE
CONTENTS OF THE CALL
$response = curl_exec($curl_handle);
curl_close($curl_handle);
?>

But $response is again set to FALSE.

Can anyone tell me what I'm doing wrong?

TIA,
Nick.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Base Data API" group.
To post to this group, send email to google-base-data-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-base-data-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-base-data-api?hl=en.

Reply via email to