public function GAFeed::getAccessToken in Google Analytics Reports 6
Same name and namespace in other branches
- 7 GAFeed.lib.inc \GAFeed::getAccessToken()
OAuth step #3: Fetch access token.
File
- ./
GAFeed.lib.inc, line 130 - Provides the GAFeed object type and associated methods.
Class
- GAFeed
- GAFeed class to authorize access to and request data from the Google Analytics Data Export API.
Code
public function getAccessToken() {
$this
->setHost($this->OAuthHost);
$this
->setQueryPath('accounts/OAuthGetAccessToken');
$params = array(
'oauth_verifier' => $this->verifier,
);
$this
->query($this->queryPath, $params, 'GET', array(
'refresh' => TRUE,
));
parse_str($this->response->data, $token);
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}