There doesn't appear to be any issues with the code you're providing. Can you inspect the OAuth2Handler class to see if it has the scope property set?
var_dump($user->GetOAuth2Handler()); Also, double check that you've not changed the OAUTH2_HANDLER_CLASSspecified in the settings.ini<https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/AdWords/settings.ini#40> . Regards, - Paul, AdWords API Team. On Sunday, 27 October 2013 11:14:33 UTC, Alan Coleman wrote: > > Hello everyone, > > I'm successfully generating *$authorizationUrl* using the code below. > However on using that URL I'm receiving the error: > > *Missing required parameter: scope.* > > *OAUTH2_SCOPE* is being declared as a constant in the* AdWordsUser* class > so I'm confused as to why it's not being carried across. > > I'm working with the following: > > Library: adwords_api_php_4.5.1 > Version: v201306 > > As Always, any ideas would be appreciated. > > > > > function GetOAuth2Credential($user, $callbackUrl) { > $redirectUri = $callbackUrl; > $offline = TRUE; > // Get the authorization URL for the OAuth2 token. > // Pass in a redirect URL back to the application, > // Passing true for the second parameter ($offline) will provide us > a refresh > // token which can used be refresh the access token when it expires. > $OAuth2Handler = $user->GetOAuth2Handler(); > $authorizationUrl = $OAuth2Handler->GetAuthorizationUrl( > $user->GetOAuth2Info(), $redirectUri, $offline); > > return $authorizationUrl; > } > > // Create a new user and set the oAuth settings > $user = new AdWordsUser(); > $user->LogAll(); > $user->SetOAuth2Info(array( > "client_id" => $clientId, > "client_secret" => $clientSecret > )); > // Generate an authorization URL given the callback URL > $authUrl = GetOAuth2Credential($user, $callbackUrl); > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.