Hi Eric,
I am back to the project again and this is one of my samples. I tried many
combinations, but those did not work. I need to figure out a solution
quickly to complete my project on time.
Due to the existing infrastructure, I have to do this in Perl.
Thanks in advance for your help.
Suraiya


Code
-------------------------------------------------------

        #hard coded value for the purpose of testing
        #trying to get keyword variations for a seed keyword

        my $keyword = "monkey";
        my $match_type = 'BROAD';
        my $language = 'en';
        my $country = 'US';
        my $service;
        my $headers;

        my $paging = Google::AdWords::v200909::Types::Paging->new(
                {
                        startIndex=> 0,numberResults=> 6
                }

        );

        my $relatedToKeywordSearchParameter =
Google::AdWords::v200909::Types::RelatedToKeywordSearchParameter->new();

        $relatedToKeywordSearchParameter->set_keywords(
                        [{text => "$keyword",matchType =>  "$match_type"
}]);

        my $selector =
Google::AdWords::v200909::Types::TargetingIdeaSelector->new({requestType =>
'IDEAS',paging =>$paging,ideaType => 'KEYWORD', searchParameters =>
$relatedToKeywordSearchParameter});

        $service = Google::AdWords::v200909::TargetingIdeaService->new();


        #getting token after authentication
        my $authToken =  Google::AdWords::AuthToken::get_token({
                        email => 'x...@xxx.com',password => 'xxxxxxx'}
        );

        #forming request header
        $headers =
Google::AdWords::v200909::TargetingIdeaService::RequestHeader->new(
                {
                        applicationToken =>  'xxxxxxxxxxxxxxxxxx',
                        authToken =>  "$authToken",
                        clientCustomerId =>  'xxxxxxxxxxx',
                        developerToken =>  'xxxxxxxxxxxxxx'
                }
        );

        ...
        #trying to get keyword suggestions for a seed keyword
        my %ret = $service->get( $selector , $header);
        ...
        ...
        ...
        print Dumper(%ret);




Part of the output that I got after executing the code:
----------------------------------------------------------------------------


SOAP::Transport::HTTP::Client::send_receive: POST
https://adwords.google.com/api/adwords/o/v200909/TargetingIdeaServiceHTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 1000
Content-Type: text/xml; charset=utf-8SOAPAction: ""<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"; ><SOAP-ENV:Header><RequestHeader
xmlns="https://adwords.google.com/api/adwords/o/v200909";><applicationToken>xxxxxxxxxx</applicationToken><authToken>xxxxxxxxxxxxxxx</authToken><clientCustomerId>xxxxxxxxxxx</clientCustomerId><developerToken>xxxxxxxxxxxxx</developerToken></RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><searchParameters
xsi:type="RelatedToKeywordSearchParameter"><keywords><text>monkey</text><matchType>BROAD</matchType></keywords></searchParameters><ideaType>KEYWORD</ideaType><requestType>IDEAS</requestType><paging><startIndex>0</startIndex><numberResults>6</numberResults></paging></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x1ff8250)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Cache-Control: private, max-age=0

<soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Message
part searchParameters was not
recognized.</faultstring></soap:Fault></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::DESTROY: ()

-- 
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-...@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