I am trying to run the reporting example (DownloadCriteriaReport), and have been fighting my way through problems:
1) I am generating an access token with:
$handler = new SimpleOAuth2Handler($server, $scope);
$credentials = array( 'client_id' => <my client id>,
'client_secret' =><my client secret>,
// Get the authorization code from the URL
$token_info = $handler->GetAccessToken($credentials, $code, $redirectURL);
First problem: The token returned does not include a refresh token. I have "access_type=offline" specified.
2) I then turn to the sample "GetRefreshToken", because I know I need that. I had to play with this code to make it work, but
I did get a refresh token back, which I saved into auth.ini.
3) I then try to run the reporting sample "DownloadCriteriaReport.php", and I get the error that my OAUTH token is invalid. I'm using the same authi.ini (with the new refresh token added, so the error confuses me.
Any suggestions?
thanks,
andy