Ray, this is my request/response logs to ADD/GET Keywords using JAVA API. ADD REQUEST/RESPONSE:
12056 [main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.requestInfoLogger - Request made: Service: "AdGroupCriterionServiceInterfacePort" Method: "mutate" URL: "https://adwords.google.com/api/adwords/cm/v201309/AdGroupCriterionService" 12064 [main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP Request: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> !HIDDEN! </soapenv:Header> <soapenv:Body> <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201309"> <operations> <operator>ADD</operator> <operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201309" xsi:type="ns2:BiddableAdGroupCriterion"> <ns2:adGroupId>14185764432</ns2:adGroupId> <ns2:criterion xsi:type="ns2:Keyword"> <ns2:text>protein</ns2:text> <ns2:matchType>EXACT</ns2:matchType> </ns2:criterion> <ns2:destinationUrl>http://test.com/123.html</ns2:destinationUrl> <ns2:biddingStrategyConfiguration> <ns2:bids xsi:type="ns2:CpcBid"> <ns2:bid> <ns2:microAmount>130000000</ns2:microAmount> </ns2:bid> </ns2:bids> </ns2:biddingStrategyConfiguration> </operand> </operations> </mutate> </soapenv:Body> </soapenv:Envelope> 12064 [main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP Response: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201309"> <requestId>0004f4f8ed2168780ae0364200004bfc</requestId> <serviceName>AdGroupCriterionService</serviceName> <methodName>mutate</methodName> <operations>1</operations> <responseTime>305</responseTime> </ResponseHeader> </soap:Header> <soap:Body> <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201309"> <rval> <ListReturnValue.Type>AdGroupCriterionReturnValue</ListReturnValue.Type> <value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion"> <adGroupId>14185764432</adGroupId> <criterion xsi:type="Keyword"> <id>18190021</id> <type>KEYWORD</type> <Criterion.Type>Keyword</Criterion.Type> <text>protein</text> <matchType>EXACT</matchType> </criterion> <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type> <userStatus>ACTIVE</userStatus> <systemServingStatus>ELIGIBLE</systemServingStatus> <approvalStatus>PENDING_REVIEW</approvalStatus> <destinationUrl>http://test.com/123.html</destinationUrl> <biddingStrategyConfiguration> <biddingStrategyType>MANUAL_CPC</biddingStrategyType> <biddingStrategySource>CAMPAIGN</biddingStrategySource> <biddingScheme xsi:type="ManualCpcBiddingScheme"> <BiddingScheme.Type>ManualCpcBiddingScheme</BiddingScheme.Type> <enhancedCpcEnabled>false</enhancedCpcEnabled> </biddingScheme> <bids xsi:type="CpcBid"> <Bids.Type>CpcBid</Bids.Type> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>130000000</microAmount> </bid> <cpcBidSource>CRITERION</cpcBidSource> </bids> <bids xsi:type="CpmBid"> <Bids.Type>CpmBid</Bids.Type> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>150000</microAmount> </bid> <cpmBidSource>ADGROUP</cpmBidSource> </bids> </biddingStrategyConfiguration> </value> </rval> </mutateResponse> </soap:Body> </soap:Envelope> =============================================================================================================== GET REQUEST/RESPONSE 108145 [main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.requestInfoLogger - Request made: Service: "AdGroupCriterionServiceInterfacePort" Method: "get" URL: "https://adwords.google.com/api/adwords/cm/v201309/AdGroupCriterionService" 108155 [main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP Request: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> !HIDDEN! </soapenv:Header> <soapenv:Body> <get xmlns="https://adwords.google.com/api/adwords/cm/v201309"> <serviceSelector> <fields>Id</fields> <fields>AdGroupId</fields> <fields>MatchType</fields> <fields>KeywordText</fields> <fields>CpcBid</fields> <predicates> <field>AdGroupId</field> <operator>IN</operator> <values>14185769112</values> </predicates> <predicates> <field>CriteriaType</field> <operator>EQUALS</operator> <values>KEYWORD</values> </predicates> <ordering> <field>AdGroupId</field> <sortOrder>ASCENDING</sortOrder> </ordering> <paging> <startIndex>0</startIndex> <numberResults>100</numberResults> </paging> </serviceSelector> </get> </soapenv:Body> </soapenv:Envelope> 108155 [main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP Response: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201309"> <requestId>0004f4f8fcde47180ae0b30b00002f4f</requestId> <serviceName>AdGroupCriterionService</serviceName> <methodName>get</methodName> <operations>1</operations> <responseTime>108</responseTime> </ResponseHeader> </soap:Header> <soap:Body> <getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201309"> <rval> <totalNumEntries>3</totalNumEntries> <Page.Type>AdGroupCriterionPage</Page.Type> <entries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion"> <adGroupId>14185769112</adGroupId> <criterionUse>BIDDABLE</criterionUse> <criterion xsi:type="Keyword"> <id>18190021</id> <type>KEYWORD</type> <Criterion.Type>Keyword</Criterion.Type> <text>protein</text> <matchType>EXACT</matchType> </criterion> <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type> <biddingStrategyConfiguration> <bids xsi:type="CpcBid"> <Bids.Type>CpcBid</Bids.Type> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>130000000</microAmount> </bid> <cpcBidSource>CRITERION</cpcBidSource> </bids> </biddingStrategyConfiguration> </entries> <entries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion"> <adGroupId>14185769112</adGroupId> <criterionUse>BIDDABLE</criterionUse> <criterion xsi:type="Keyword"> <id>18190021</id> <type>KEYWORD</type> <Criterion.Type>Keyword</Criterion.Type> <text>protein</text> <matchType>EXACT</matchType> </criterion> <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type> <biddingStrategyConfiguration> <bids xsi:type="CpcBid"> <Bids.Type>CpcBid</Bids.Type> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>130000000</microAmount> </bid> <cpcBidSource>CRITERION</cpcBidSource> </bids> </biddingStrategyConfiguration> </entries> <entries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion"> <adGroupId>14185769112</adGroupId> <criterionUse>BIDDABLE</criterionUse> <criterion xsi:type="Keyword"> <id>18190021</id> <type>KEYWORD</type> <Criterion.Type>Keyword</Criterion.Type> <text>protein</text> <matchType>EXACT</matchType> </criterion> <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type> <biddingStrategyConfiguration> <bids xsi:type="CpcBid"> <Bids.Type>CpcBid</Bids.Type> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>130000000</microAmount> </bid> <cpcBidSource>CRITERION</cpcBidSource> </bids> </biddingStrategyConfiguration> </entries> </rval> </getResponse> </soap:Body> </soap:Envelope> As you can see I've successfully sent request to add one keyword, but when I am trying to get keywords it returns me 3. Note that adwords UI shows only one keyword after my API competed execution. Also I am including my code how I add a key word: public AdGroupCriterionReturnValue addKeyWord(Long adGroupId, String keyWord, KeywordMatchType matchType, Money bidAmount, String destinationURL) throws ApiException, RemoteException{ Keyword newKeyWord = new Keyword(); newKeyWord.setText(keyWord); newKeyWord.setMatchType(matchType); BiddableAdGroupCriterion keywordBiddableAdGroupCriterion = new BiddableAdGroupCriterion(); keywordBiddableAdGroupCriterion.setAdGroupId(adGroupId); keywordBiddableAdGroupCriterion.setCriterion(newKeyWord); keywordBiddableAdGroupCriterion.setDestinationUrl(destinationURL); BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration(); CpcBid bid = new CpcBid(); bid.setBid(bidAmount); biddingStrategyConfiguration.setBids(new Bids[] {bid}); keywordBiddableAdGroupCriterion.setBiddingStrategyConfiguration(biddingStrategyConfiguration); AdGroupCriterionOperation keywordAdGroupCriterionOperation = new AdGroupCriterionOperation(); keywordAdGroupCriterionOperation.setOperand(keywordBiddableAdGroupCriterion); keywordAdGroupCriterionOperation.setOperator(Operator.ADD); AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] {keywordAdGroupCriterionOperation}; AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); return result; } On Tuesday, 18 March 2014 21:22:56 UTC, Ray Tsang (AdWords API Team) wrote: > > Dan, > > Could I trouble you to send me the request/response log (minus any > sensitive information) using the Reply to Author feature? > > Cheers, > > Ray > > On Tuesday, March 18, 2014 10:34:49 AM UTC-4, Dan wrote: >> >> >> This is my code which I am using to pull KeyWords: >> >> public List<Keyword> getAdGroupKeyWords(Long adGroupId) throws >> ApiException, RemoteException{ >> int PAGE_SIZE = 100; >> int offset = 0; >> boolean morePages = true; >> >> SelectorBuilder builder = new SelectorBuilder(); >> Selector selector = builder >> .fields("Id", "AdGroupId", "MatchType", "KeywordText") >> .orderAscBy("AdGroupId") >> .offset(offset) >> .limit(PAGE_SIZE) >> .in("AdGroupId", adGroupId.toString()) >> .equals("CriteriaType", "KEYWORD") >> .build(); >> >> List<Keyword> adGroupPages = new ArrayList<Keyword>(); >> >> while (morePages) { >> AdGroupCriterionPage page = adGroupCriterionService.get(selector); >> if (page.getEntries() != null && page.getEntries().length > 0) { >> for(AdGroupCriterion adGroupCriterion : page.getEntries()){ >> adGroupPages.add(((Keyword)adGroupCriterion.getCriterion())); >> } >> offset += PAGE_SIZE; >> selector = builder.increaseOffsetBy(PAGE_SIZE).build(); >> morePages = offset < page.getTotalNumEntries(); >> } >> } >> >> return adGroupPages; >> } >> >> I've created 1 key word but it always return 3 absolutely same objects. >> First I thought that it 3 different match types, but no all of them >> identical. Why? >> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 [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 --- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
