Hi Scott, The AdGroupBids.Type field is read only and ignored in requests:
http://code.google.com/apis/adwords/v2009/docs/reference/CampaignService.AdGroupBids.html#AdGroupBids.Type To specify the type you need to set the xsi:type attribute on the field, which is accomplished by creating a ManualCPCAdGroupBids object like you did. Best, - Eric Koleda, AdWords API Team On Feb 25, 6:26 pm, Scott Sexton <[email protected]> wrote: > UPDATE: > If you explicitly create a ManualCPCAdGroupBids object and pass that > into the operand, it will work. > > my $new_bid = 0.14; > my $AdGroupBids = > Google::AdWords::v200909::Types::ManualCPCAdGroupBids->new({ > keywordMaxCpc => { > amount => { > microAmount => > ($new_bid*1000000)} > }}); > my $operand = {id => 1227687696, > bids => $AdGroupBids}; > my $operations = {operations => [{operator => 'SET', > operand => $operand, > }] > }; > $response = $client->AdGroupService->mutate($operations); > > Must be a bug in the AdGroupService module that won't read the normal > AdGroup object correctly. > > On Feb 25, 3:20 pm, Scott Sexton <[email protected]> wrote: > > > > > I'm using the v2009 Perl libraries. > > > I've got this code to get an ad group, where I then update the bid > > amount, and pass it back into mutate. > > > my $new_bid = 0.14; > > my $response = $client->AdGroupService()->get({selector => {adGroupIds > > => [1234567890]}}); > > my $ad_group = $response->result()->{'entries'}; > > $ad_group->{'bids'}->{'keywordMaxCpc'}->{'amount'}->{'microAmount'} = > > $new_bid*1000000; > > my $operations = {operations => [{operator => 'SET', > > operand => > > $ad_group}] > > }; > > $response = $client->AdGroupService->mutate($operations); > > > However, that generates this error: > > cannot use ManualCPCAdGroupBids reference as value for bids - > > Google::AdWords::v200909::Types::AdGroupBids required at /usr/lib/ > > perl5/site_perl/5.8.8/SOAP/WSDL/Client/Base.pm line 26 > > > An ad group object is supposed to be the argument to the operand > > according to the documentation > > here:http://code.google.com/apis/adwords/v2009/docs/reference/AdGroupServi... > > So I'm not sure why my code is incorrect. > > > As an alternative, I've tried using this hash as the operand: > > operand => {id => 1234567890, > > bids => {AdGroupBids__Type => > > 'ManualCPCAdGroupBids', > > keywordMaxCpc => { > > amount => > > { > > > microAmount => ($new_bid*1000000) > > > > } > > } > > } > > } > > This, however, errors because I'm including keywordMaxCpc. I seem to > > only be able to specify the type, but not the actual new bid amount I > > want to set. > > > How should I actually go about updating the default ad group bid? > > > Thanks for any help on this. -- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en.
