So I previously was using ClientLogin for authorization in the Google 
AdWords API but after looking at this documentation: 
https://developers.google.com/accounts/docs/AuthForInstalledApps It says 
that this mechanism has been deprecated in favor of OAuth2.0.

So I am trying to follow the documenation here: 
https://developers.google.com/accounts/docs/OAuth2

I have registered my application in the API Consoles. Now I am trying to 
follow the perl example of how to set this up: 
http://code.google.com/p/google-api-adwords-perl/source/browse/trunk/examples/v201206/misc/use_oauth2.pl

I cannot place the AdWords Client, credentials in ~/adwords.properties 
since I have multiple accounts that I will be doing Campaign Management 
operations on, and therefore multiple client ids.

But for now I tried to follow this example by using just one of my client's 
info like this:

my $client = Google::Ads::AdWords::Client->new(
    {
        version  => 'v201206',
        developer_token => TOKEN,
        client_id => $google_account_id
    }
);

$client->get_auth_token_handler()->set_email($login);
$client->get_auth_token_handler()->set_password($password);

However when I step through this, when it tries to initialize the Client 
object it throws this error:

Can't use an undefined value as a HASH reference at (eval 
845)[/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Message.pm:371] line 1. at (eval 
845)[/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Message.pm:371] line 1
HTTP::Message::__ANON__[(eval 
845)[/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Message.pm:371]:1]() called at 
/home/etienne/backend/libs/Google/Ads/Common/HTTPTransport.pm line 30
Google::Ads::Common::HTTPTransport::client('Google::Ads::Common::HTTPTransport=HASH(0xb59b830)',
 'Google::Ads::AdWords::Client=SCALAR(0x9b9bb60)') called at 
/home/etienne/backend/libs Google/Ads/AdWords/Client.pm line 180
Google::Ads::AdWords::Client::START('Google::Ads::AdWords::Client=SCALAR(0x9b9bb60)',
 1, 'HASH(0xb582e70)') called at 
/usr/lib/perl5/site_perl/5.8.8/Class/Std/Fast.pm line 251
Class::Std::Fast::__ANON__[/usr/lib/perl5/site_perl/5.8.8/Class/Std/Fast.pm:252]()
 called at /usr/lib/perl5/site_perl/5.8.8/Class/Std/Fast.pm line 287
Class::Std::Fast::new('Google::Ads::AdWords::Client', 'HASH(0xb54c210)') called 
at /home/etienne/backend/search_marketing/data_exchange/lib/GoogleAPIv2.pm line 
3555
GoogleAPIv2::get_adwords_client('GoogleAPIv2=HASH(0xb556d10)', 4202697829) 
called at 
/home/etienne/backend/search_marketing/data_exchange/lib/GoogleAPIv2.pm line 230
GoogleAPIv2::add_campaign('GoogleAPIv2=HASH(0xb556d10)', 'name', 'API Upgrade 
Test Campaign - 1348613850', 'google_account_id', 4202697829, 'account_id', 
207, 'country_code', 'US', ...) called at google_add_campaign.t line 110
main::main() called at google_add_campaign.t line 26
scalar context return from CODE(0x9b909c0): *Class::Std::Fast::_cache
1..3

I am using perl version 5.8.8 . I have installed the latest adwords perl 
client library 2.7.2 . Is there some kind of dependency issue? And how can 
I go about resolving this issue. Any information you can provide would be 
very helpful. Thanks.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

Reply via email to