I already stored the access and refresh token in my database. I want get the google client using that. I don't know how to use it in below example
$client = Zend_Gdata_ClientLogin::getHttpClient('you@there.com', 'password', Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME);
$service = new Zend_Gdata_Spreadsheets($client);
// Get worksheet feed
$query = new Zend_Gdata_Spreadsheets_DocumentQuery();
$query->setSpreadsheetKey('your spreadsheet key');
$feed = $spreadsheetService->getWorksheetFeed($query);
I want replace email and password with access token. Someone help me how to do that. I tried below. but I got only exception
Caught exception: Expected response code 200, got 401
and Stateless token expired
$client = Zend_Gdata_AuthSub::getHttpClient('ya29.XXXXXXX');
Another try,
$client = new Zend_Gdata_HttpClient();
$session_token =Zend_Gdata_AuthSub::getAuthSubSessionToken('ya29.XXXXXXX',$client);
$client->setAuthSubToken($sessionToken);
Caught exception: Token upgrade failed. Reason: