public function getOAuthToken($code, $token = false)
    {
        $apiData = array(
            'grant_type' => 'authorization_code',
            'client_id' => $this->getApiKey(),
            'client_secret' => $this->getApiSecret(),
            'redirect_uri' => $this->getApiCallback(),
            'code' => $code
        );

        $result = $this->_makeOAuthCall($apiData);

        return !$token ? $result : $result->access_token;
    }
public function getOAuthToken($code, $token = false)
    {
        $apiData = array(
            'grant_type' => 'authorization_code',
            'client_id' => $this->getApiKey(),
            'client_secret' => $this->getApiSecret(),
            'redirect_uri' => $this->getApiCallback(),
            'code' => $code
        );

        $result = $this->_makeOAuthCall($apiData);

        return !$token ? $result : $result->access_token;
    }
public function getOAuthToken ( $ code , $ token = false ) { $ apiData = array ( 'grant_type' => 'authorization_code' , 'client_id' => $ this -> getApiKey ( ) , 'client_secret' => $ this -> getApiSecret ( ) , 'redirect_uri' => $ this -> getApiCallback ( ) , 'code' => $ code ) ; $ result = $ this -> _makeOAuthCall ( $ apiData ) ; return ! $ token ? $ result : $ result -> access_token ; }
Get the OAuth data of a user by the returned callback code.

@param string $code OAuth2 code variable (after a successful login)
@param bool $token If it's true, only the access token will be returned

@return mixed
Get the OAuth data of a user by the returned callback code .