$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',
'_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,
'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',
'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
# 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.
# 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
### OAuth2 ###
# Un-comment the following keys to use OAuth 2 authorization.
# All these values are found in the Google API Console.
#
# 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
# 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