Re: Missing required parameter: scope when using $authorizationUrl

2013-11-04 Thread Alan Coleman
 Hi Paul,

Thanks very much for replying.

var_dump($user-GetOAuth2Handler()); Does indeed reveal that the scope 
variable in *SimpleOAuth2Handler* is null. 

I've hard coded the variable in Oauth2Handler.php

  public function __construct($server = NULL, $scope = *
'https://adwords.google.com/api/adwords/'*) {
$this-server = $server;
$this-scope = $scope;
  }

This seems to work although I'm unsure as to why $scope isn't being picked 
up elsewhere. Is this an acceptable solution?

Also, the OAUTH2_HANDLER_CLASS specified in the 
settings.inihttps://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/AdWords/settings.ini#40.
 
is coded out, is this correct?

Thanks again.



On Tuesday, October 29, 2013 10:49:36 AM UTC, Paul Matthews (AdWords API 
Team) wrote:

 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.inihttps://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://googleadsdeveloper.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.


Re: Missing required parameter: scope when using $authorizationUrl

2013-11-04 Thread Paul Matthews (AdWords API Team)
Hi Alan,

This looks as though there's an issue with your settings.ini, please 
compare to the original 
settings.inihttps://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/AdWords/settings.ini#34and
 confirm the changes are correct. Yes the 
OAUTH2_HANDLER_CLASS should be commented out as it defaults to the 
SimpleOAuth2Handler.

The scope should be configured by the AdWordsUser object, from the class 
constant. Is there a reason why your system wouldn't honor the class 
constant? Are you extending the AdWordsUser or have you changed the 
GetDefaultOAuth2Handler implementation?

Regards,

- Paul, AdWords API Team.

On Monday, 4 November 2013 11:46:41 UTC, Alan Coleman wrote:

  Hi Paul,

 Thanks very much for replying.

 var_dump($user-GetOAuth2Handler()); Does indeed reveal that the scope 
 variable in *SimpleOAuth2Handler* is null. 

 I've hard coded the variable in Oauth2Handler.php

   public function __construct($server = NULL, $scope = *'
 https://adwords.google.com/api/adwords/'*) {
 $this-server = $server;
 $this-scope = $scope;
   }

 This seems to work although I'm unsure as to why $scope isn't being picked 
 up elsewhere. Is this an acceptable solution?

 Also, the OAUTH2_HANDLER_CLASS specified in the 
 settings.inihttps://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/AdWords/settings.ini#40.
  
 is coded out, is this correct?

 Thanks again.



 On Tuesday, October 29, 2013 10:49:36 AM UTC, Paul Matthews (AdWords API 
 Team) wrote:

 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.inihttps://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://googleadsdeveloper.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.


Re: Missing required parameter: scope when using $authorizationUrl

2013-10-29 Thread Paul Matthews (AdWords API Team)
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.inihttps://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.