i am sorry i framed it wrongly. first i want to clear my basics with Google Docs and Spreadsheets. then i will make an api that will invite people to my site using google contacts of my site's members, for that i need contacts. but at moment i am stuck at Google Docs and Spreadsheets what is happening is i can get oauth token and verifier(after user is authorizing me) but from some "god know what" reason i am not able to get/exchange the access token.
can you tell me where is error in this file which is the callback url require_once 'Zend/Oauth/Consumer.php'; > > >> >> $CONSUMER_KEY = '**********************'; > > $CONSUMER_SECRET = '*****************************'; > > >> >> >> >> $oauthOptions = array( > > 'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER, > > 'version' => '1.0', > > 'consumerKey' => $CONSUMER_KEY, > > 'consumerSecret' => $CONSUMER_SECRET, > > 'signatureMethod' => 'HMAC-SHA1', > > 'callbackUrl' => 'http://techbits.co.in/mani/ind2.php', > > 'requestTokenUrl' => ' >> https://www.google.com/accounts/OAuthGetRequestToken', > > 'userAuthorizationUrl' => ' >> https://www.google.com/accounts/OAuthAuthorizeToken', > > 'accessTokenUrl' => 'https://www.google.com/accounts/OAuthGetAccessToken >> ' > > ); > > >> $consumer = new Zend_Oauth_Consumer($oauthOptions); > > if (!isset($_SESSION['ACCESS_TOKEN'])) {echo "in first if /br"; > > if (!empty($_GET) && isset($_SESSION['REQUEST_TOKEN'])) { echo >> "gotm".$_SESSION['REQUEST_TOKEN']; > > $_SESSION['ACCESS_TOKEN'] = serialize($consumer->getAccessToken($_GET, >> unserialize($_SESSION['REQUEST_TOKEN']))); > > } > > } > > >> echo "fine "; > > require_once 'Zend/Gdata/Docs.php'; > > >> if (isset($_SESSION['ACCESS_TOKEN'])) { > > $accessToken = unserialize($_SESSION['ACCESS_TOKEN']); > > } else { > > exit; > > } > > >> echo " till".$accessToken; > > /* Or, you could set an existing token (say one stored from your >> database). For HMAC-SHA1: > > $accessToken = new Zend_Oauth_Token_Access(); > > $accessToken->setToken('1/AQfoI-qJDqkvvkf216Gc2g'); > > $accessToken->setTokenSecret('2c26GLW250tZiQ'); > > */ > > >> $httpClient = $accessToken->getHttpClient($oauthOptions); > > echo "here"; > > $client = new Zend_Gdata_Docs($httpClient, "yourCompany-YourAppName-v1"); > > echo "almost over"; > > // Retrieve user's list of Google Docs > > $feed = $client->getDocumentListFeed(); > > foreach ($feed->entries as $entry) { > > echo "$entry->title\n"; > > } > > echo "done"; > > ?> > > On Tue, Mar 8, 2011 at 11:04 PM, Alain <[email protected]> wrote: > According to the error, it seems that you manage to authenticate to the > service. But are you trying to access Google Docs and Spreadsheets or Google > Contacts? For the former, I would suggest going to those APIs forums > here<http://code.google.com/apis/documents/forum.html>and > here <http://code.google.com/apis/spreadsheets/forum.html>. > For the latter, you would need to change the scope to ' > https://www.google.com/m8/feeds': > > [CODE] > $SCOPES = array( > 'https://www.google.com/m8/feeds', > ); > [/CODE] > > After that, you will need to call the appropriate method for interacting > with the user's contacts. Please refer to the Zend framework > documentation<http://framework.zend.com/manual/en/zend.gdata.html> > . > Unfortunately, there doesn't seem to be a wrapper around the Contacts API > but you should be able to do something similar to this: > > [CODE] > $query = new Zend_Gdata_Query(' > http://www.google.com/m8/feeds/contacts/default/full'); > $feed = $gdata->getFeed($query); > [/CODE] > > For additional resources, you can consult this excellent > tutorial<http://www.ibm.com/developerworks/opensource/library/x-phpgooglecontact/index.html> > . > > Best, > Alain > > -- > You received this message because you are subscribed to the Google > Groups "Google Contacts, Shared Contacts and User Profiles APIs" 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://code.google.com/apis/contacts/community/forum.html > -- You received this message because you are subscribed to the Google Groups "Google Contacts, Shared Contacts and User Profiles APIs" 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://code.google.com/apis/contacts/community/forum.html
