$VAR1 = bless( {
                 'ssl_opts' => {
                                 'verify_hostname' => 1
                               },
                 'res' => bless( {
                                   '_protocol' => 'HTTP/1.1',
                                   '_content' => '<?xml version="1.0" 
encoding="UTF-8" 
standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.INVALID_PARAMETER</type><trigger>Missing
 
client 
information</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>',
                                   '_rc' => 400,
                                   '_headers' => bless( {
                                                          'connection' => 
'close',
                                                          'cache-control' 
=> 'private, max-age=0',
                                                          'date' => 'Mon, 
21 Jul 2014 07:39:35 GMT',
                                                          
'client-ssl-cert-issuer' => '/C=US/O=Google Inc/CN=Google Internet 
Authority G2',
                                                          
'client-ssl-cipher' => 'xxxxx-xxx-xxxxxx-xxx',
                                                          'client-peer' => 
'xx.xx.xx.xx:443',
                                                          'client-date' => 
'Mon, 21 Jul 2014 07:39:35 GMT',
                                                          'content-type' => 
'text/xml',
                                                          
'x-xss-protection' => '1; mode=block',
                                                          'server' => 'GSE',
                                                          
'client-ssl-socket-class' => 'IO::Socket::SSL',
                                                          
'client-response-num' => 1,
                                                          'x-frame-options' 
=> 'SAMEORIGIN',
                                                          
'x-content-type-options' => 'nosniff',
                                                          
'client-ssl-cert-subject' => '/C=US/ST=California/L=Mountain View/O=Google 
Inc/CN=*.google.com',
                                                          'expires' => 
'Mon, 21 Jul 2014 07:39:35 GMT'
                                                        }, 'HTTP::Headers' 
),
                                   '_msg' => 'Bad Request',
                                   '_request' => bless( {
                                                          '_content' => 
'__rdquery=SELECT%2BCampaignName%2BCampaignId%2BCost%2BFROM%2BCAMPAIGN_PERFORMANCE_REPORT%2BDURING%2B20140619%2C20140619&__fmt=CSV',
                                                          '_uri' => bless( 
do{\(my $o = 
'https://adwords.google.com/api/adwords/reportdownload/v201406')}, 
'URI::https' ),
                                                          '_headers' => 
bless( {
                                                                            
     'user-agent' => 'WWW-Mechanize/1.72',
                                                                            
     'content-type' => 'application/x-www-form-urlencoded',
                                                                            
     'accept-encoding' => 'gzip',
                                                                            
     'content-length' => 129
                                                                            
   }, 'HTTP::Headers' ),
                                                          '_method' => 
'POST',
                                                          '_uri_canonical' 
=> $VAR1->{'res'}{'_request'}{'_uri'}
                                                        }, 'HTTP::Request' )
                                 }, 'HTTP::Response' ),
                 'page_stack' => [],
                 'requests_redirectable' => [
                                              'GET',
                                              'HEAD',
                                              'POST'
                                            ],
                 'timeout' => 180,
                 'onerror' => sub { "DUMMY" },
                 'links' => undef,
                 'base' => bless( do{\(my $o = 
'https://adwords.google.com/api/adwords/reportdownload/v201406')}, 
'URI::https' ),
                 'images' => undef,
                 'noproxy' => 0,
                 'show_progress' => undef,
                 'protocols_forbidden' => undef,
                 'no_proxy' => [],
                 'protocols_allowed' => undef,
                 'use_eval' => 1,
                 'local_address' => undef,
                 'autocheck' => 1,
                 'title' => undef,
                 'def_headers' => bless( {
                                           'user-agent' => 
'WWW-Mechanize/1.72'
                                         }, 'HTTP::Headers' ),
                 'proxy' => {},
                 'max_size' => undef,
                 'headers' => {
                                'HASH(0xa63b65c)' => undef
                              },
                 'req' => $VAR1->{'res'}{'_request'},
                 'status' => '400',
                 'forms' => undef,
                 'ct' => 'text/xml',
                 'redirected_uri' => 
'https://adwords.google.com/api/adwords/reportdownload/v201406',
                 'text' => undef,
                 'current_form' => undef,
                 'quiet' => 0,
                 'max_redirect' => 7,
                 'stack_depth' => 8675309,
                 'handlers' => {
                                 'request_prepare' => bless( [
                                                               {
                                                                 'owner' => 
'LWP::UserAgent::cookie_jar',
                                                                 'callback' 
=> sub { "DUMMY" },
                                                                 'line' => 
'/usr/local/share/perl/5.14.2/LWP/UserAgent.pm:704'
                                                               }
                                                             ], 
'HTTP::Config' ),
                                 'response_header' => bless( [
                                                               {
                                                                 'owner' => 
'LWP::UserAgent::parse_head',
                                                                 'callback' 
=> sub { "DUMMY" },
                                                                
 'm_media_type' => 'html',
                                                                 'line' => 
'/usr/local/share/perl/5.14.2/LWP/UserAgent.pm:683'
                                                               }
                                                             ], 
'HTTP::Config' ),
                                 'response_done' => bless( [
                                                             {
                                                               'owner' => 
'LWP::UserAgent::cookie_jar',
                                                               'callback' 
=> sub { "DUMMY" },
                                                               'line' => 
'/usr/local/share/perl/5.14.2/LWP/UserAgent.pm:707'
                                                             }
                                                           ], 
'HTTP::Config' )
                               },
                 'onwarn' => sub { "DUMMY" },
                 'cookie_jar' => bless( {
                                          'COOKIES' => {}
                                        }, 'HTTP::Cookies' )
               }, 'WWW::Mechanize' );

This is the dump of Mech object which i tried , also i tried using other 
approach that is using library of Perl 

here is the content of adword properties file for libraries with credential 
as xxxxxxxxxxxxxx
# Please see http://code.google.com/apis/adwords/docs/headers.html
# for an overview of header information.

# A string of your choosing, used to identify your application.
userAgent=xxxx.com:ReportDownloader:V7.18

# A 22 character Developer Token.
developerToken=xxxxxxxxxxxxxxxxxxxxxx

# To use an alternative URL in case you want to manually proxy your requests
# or fake the API servers.
# alternateUrl=https://my-fake-server-address

# The Client Customer ID of the client account your application will access.
# This can be programmatically set in the Client object as
# $client->set_client_id
clientId=xxx-xxx-xxxx

### Peer verification of SSL certificates ###
#
# To avoid spoofing attacks, enable either a CAPath or CAFile for SSL
# certificates validation.
#
# This library can use two different underlying SSL modules either
# IO::Socket::SSL or Crypt::SSLeay, being IO::Socket::SSL the default and
# recommended since it can do certificate authenticity validation as well as
# hostname validation while Crypt::SSLeay does not support hostname 
validation.

# The certificate authority directory to search in when performing peer
# validation. For example: /etc/ssl/certs
# CAPath=<PATH TO CERTIFICATE AUTHORITY DIRECTORY>

# The certificate authority file to use when performing peer validation.
# For example: /etc/ssl/certs/ca-certificates.crt
# CAFile=<PATH TO CERTIFICATE AUTHORITY FILE>

### Authorization Mechanisms ###
#
# The library supports the OAuth2, OAuth1.0a and ClientLogin mechanisms. 
Need to
# choose one, un-comment and fill in its details.
#
# More details about authorization options supported by the library can be 
found
# in the README, section "Authorization Options".
#
# Also to learn more about API authorization please visit
# https://developers.google.com/accounts/docs/GettingStarted

### OAuth2 ###

# Un-comment the following keys to use OAuth 2 authorization.
# All these values are found in the Google API Console.
#
oAuth2ClientId=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com 

# For the Web/Installed Applications flow, un-comment the following.
#
oAuth2ClientSecret=xxxxxxxxxxxxxxxxxxxxxxxx
#
# Then you need one of the following two options.
#
# Option 1: un-comment the following if you already have OAuth2 
authorization
# tokens.
oAuth2AccessToken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
oAuth2RefreshToken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#
# Option 2: Use the library to trigger the authorization flow and have the
# user authorize access to his account. See the
# examples/oauth/generate_offline_credentials.pl to learn how to use the
# library for requesting user authorization.
#
# Optionally, un-comment the following if you want to change defaults for 
the
# user interaction flow.
# Default offline
# oAuth2AccessType=[online|offline]
# Default auto
# oAuth2ApprovalPrompt=[force|auto]
# Defaults to urn:ietf:wg:oauth:2.0:oob
# oAuth2RedirectUri=INSERT_REDIRECT_URI_HERE

# For the Service Accounts flow, un-comment the following.
#
# In order to user the library for service accounts you need to transform 
your
# p12 certificate as generated by the Google API Console to PEM format. And 
make
# sure no password is set.
# In Linux/Unix systems with openssl installed you can execute.
# > openssl pkcs12 -in {private-key}.p12 -out {private-key}.pem -nodes
#
# 
oAuth2ServiceAccountEmailAddress=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# 
oAuth2ServiceAccountDelegateEmail=INSERT_EMAIL_OF_ACCOUNT_TO_IMPERSONATE_HERE
# oAuth2ServiceAccountPEMFile=INSERT_PATH_TO_YOUR_CERTIFICATE_FILE_HERE

### OAuth1 ###

# Notice this authorization method is already deprecated and OAuth2 should 
be
# used in preference.

# Un-comment the following to use OAuth 1.0a as authorization method.
# oAuthConsumerKey=INSERT_OAUTH_CONSUMER_KEY_HERE
# oAuthConsumerSecret=INSERT_OAUTH_CONSUMER_SECRET_HERE
# oAuthDisplayName=OPTIONAL_INSERT_OAUTH_DISPLAY_NAME_HERE

# Optionally: un-comment the following if you already have OAuth 1.0a 
authorization tokens.
# oAuthToken=INSERT_OAUTH_TOKEN_HERE
# oAuthTokenSecret=INSERT_OAUTH_TOKEN_SECRET_HERE

### ClientLogin ###

# Notice this authorization method is already deprecated and OAuth2 should 
be
# used in preference.

# Un-comment the following to use ClientLogin
# email=INSERT_LOGIN_EMAIL_HERE
# password=INSERT_PASSWORD_HERE

# Or set the following to use an existing AuthToken.
# This is optional, and if set email and password will not be used.
# authToken=INSERT_AUTH_TOKEN_HERE

using that i got error as follows
The library couldn't find any authorization mechanism set up to properly 
sign the requests against the API. Please read the following guide on how 
to setup OAuth2 
https://github.com/googleads/googleads-perl-lib/wiki/Using-OAuth-2.0 at 
../../../lib/Google/Ads/Common/HTTPTransport.pm line 47.



On Tuesday, July 15, 2014 9:13:42 PM UTC+5:30, Dhiraj Shinde wrote:
>
> Hi All,
>          I am working on project which need some Google ad-word API usage, 
> actually i need to download campaign_performance_report for my client for 
> particular date, using the following script
>  
>   my $mech = WWW::Mechanize->new();
>   $mech->add_header({
> clientCustomerId => "xxx-xxx-xxxx",#valid client customer id
> 'Authorization: Bearer' =>'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',#my 
> access token with scope manage adword campaign
> developerToken => 'xxxxxxxxxxxxxxxxxxx'});
> $response = $mech->post("
> https://adwords.google.com/api/adwords/reportdownload/v201406";,
> { __rdquery => 
> 'SELECT+CampaignName+CampaignId+Cost+FROM+CAMPAIGN_PERFORMANCE_REPORT+DURING+20140619,20140619',__fmt
>  
> => 'CSV'
> }
> );
>
> when i see the response of above request i got 
> <?xml version="1.0" encoding="UTF-8" 
> standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.INVALID_PARAMETER</type><trigger>Missing
>  
> client 
> information</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>
>
> i am following approach mentioned in the link
> https://developers.google.com/adwords/api/docs/guides/awql
>
> i don't understand what exactly is missing ?
> need help from expert 
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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/d/optout.

Reply via email to