I began started working with the Google Base Data API, and I've run
into a mysterious error.
My application (PHP based) works fine the first time a user authorizes
my application to access the data on their Google Account. I then
receive the token and exchange it for a non-expiring session token.
The problem arises whenever a user revisits my application. When my
application tries to read the items feed, I get the following
response:
<errors>
<error type="request" reason="Service not found"/>
</errors>
Regardless of whether I generate a new session token or reuse the
previous one, I get the above error.
Can anyone offer advice for tackling this problem?
(The code below handles my session tokens)
if($_GET['token']) {
$old_token = $_GET['token'];
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'https://www.google.com/accounts/
AuthSubSessionToken');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_FAILONERROR,true);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Authorization: AuthSub
token="'.$old_token.'"'));
$result = curl_exec($ch); /* Execute the HTTP command. */
//parse output
$splitStr = split("=",$result);
$token = trim($splitStr[1]);
}
else {
$token = 'previous session token';
}
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Base-data-API?hl=en
-~----------~----~----~----~------~----~------~--~---