public function getAccessCredentials($code, $state = null)
    {
        return $this->post('oauth2/token', [
            'client_id' => $this->getClientId(),
            'client_secret' => $this->getClientSecret(),
            'grant_type' => 'authorization_code',
            'redirect_uri' => $this->getRedirectUri(),
            'code' => $code,
            'state' => $state,
        ]);
    }
public function getAccessCredentials($code, $state = null)
    {
        return $this->post('oauth2/token', [
            'client_id' => $this->getClientId(),
            'client_secret' => $this->getClientSecret(),
            'grant_type' => 'authorization_code',
            'redirect_uri' => $this->getRedirectUri(),
            'code' => $code,
            'state' => $state,
        ]);
    }
public function getAccessCredentials ( $ code , $ state = null ) { return $ this -> post ( 'oauth2/token' , [ 'client_id' => $ this -> getClientId ( ) , 'client_secret' => $ this -> getClientSecret ( ) , 'grant_type' => 'authorization_code' , 'redirect_uri' => $ this -> getRedirectUri ( ) , 'code' => $ code , 'state' => $ state , ] ) ; }
Get a user's access credentials, which includes the access token

@param string $code
@param string $state
@return array|json
Get a user s access credentials which includes the access token