$options = array(
‘requestScheme’ => Zend_Oauth::REQUEST_SCHEME_HEADER,
‘version’ => ‘1.0’,
‘signatureMethod’ => ‘HMAC-SHA1’,
‘consumerKey’ => $consumer_Key,
‘consumerSecret’ => $consumer_secret_key
);
/**
* Create HTTP Client object with OAuth
*/
try {
$oauthConsumer = new Zend_Oauth_Consumer($options);
$token = new Zend_Oauth_Token_Access();
$httpClient = $token->getHttpClient($options);
$userClient = new Zend_Gdata_Gapps($httpClient,$domain);
$users = $userClient->retrieveAllUsers();
}catch(Exception $e){
echo $e->getMessage();
}

Advertisements