Hi Oliver, Here's a log that shows you how a partialFailure request looks like. You can see that the second and 4th operations fail, so they have an empty AdGroupCriterion node (bolded). The partialFailures node tells what went wrong.
Cheers, Anash AdsClientLibs.DetailedRequestLogs Information: 1 : -----------------BEGIN API CALL--------------------- Request ------- <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"> <soap:Header> <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201409" > <developerToken>******</developerToken> <clientCustomerId>******</clientCustomerId> <userAgent>INSERT_YOUR_COMPANY_OR_APPLICATION_NAME_HERE (AwApi-DotNet/ 18.7.0, Common-Dotnet/3.5.0, .NET CLR/4.0.30319.34209, gzip)</userAgent> <partialFailure>true</partialFailure> </RequestHeader> </soap:Header> <soap:Body> <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201409"> <operations> <operator>ADD</operator> <operand xsi:type="BiddableAdGroupCriterion"> <adGroupId>2035225096</adGroupId> <criterion xsi:type="Keyword"> <text>mars cruise</text> <matchType>BROAD</matchType> </criterion> </operand> </operations> <operations> <operator>ADD</operator> <operand xsi:type="BiddableAdGroupCriterion"> <adGroupId>2035225096</adGroupId> <criterion xsi:type="Keyword"> <text>inv@lid cruise</text> <matchType>BROAD</matchType> </criterion> </operand> </operations> <operations> <operator>ADD</operator> <operand xsi:type="BiddableAdGroupCriterion"> <adGroupId>2035225096</adGroupId> <criterion xsi:type="Keyword"> <text>venus cruise</text> <matchType>BROAD</matchType> </criterion> </operand> </operations> <operations> <operator>ADD</operator> <operand xsi:type="BiddableAdGroupCriterion"> <adGroupId>2035225096</adGroupId> <criterion xsi:type="Keyword"> <text>b(a)d keyword cruise</text> <matchType>BROAD</matchType> </criterion> </operand> </operations> </mutate> </soap:Body> </soap:Envelope> 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/v201409"> <requestId>00050d38a2c41f480ab6426e570076f6</requestId> <serviceName>AdGroupCriterionService</serviceName> <methodName>mutate</methodName> <operations>0</operations> <responseTime>306</responseTime> </ResponseHeader> </soap:Header> <soap:Body> <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201409 "> <rval> <ListReturnValue.Type>AdGroupCriterionReturnValue</ListReturnValue.Type> <value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion"> <adGroupId>2035225096</adGroupId> <criterion xsi:type="Keyword"> <id>376765347</id> <type>KEYWORD</type> <Criterion.Type>Keyword</Criterion.Type> <text>mars cruise</text> <matchType>BROAD</matchType> </criterion> <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion. Type> <userStatus>ENABLED</userStatus> <systemServingStatus>ELIGIBLE</systemServingStatus> <approvalStatus>APPROVED</approvalStatus> <biddingStrategyConfiguration> <biddingStrategyType>MANUAL_CPC</biddingStrategyType> <biddingStrategySource>CAMPAIGN</biddingStrategySource> <biddingScheme xsi:type="ManualCpcBiddingScheme"> <BiddingScheme.Type>ManualCpcBiddingScheme</BiddingScheme.Type > <enhancedCpcEnabled>true</enhancedCpcEnabled> </biddingScheme> <bids xsi:type="CpcBid"> <Bids.Type>CpcBid</Bids.Type> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>530000</microAmount> </bid> <cpcBidSource>ADGROUP</cpcBidSource> </bids> </biddingStrategyConfiguration> </value> *<value> <AdGroupCriterion.Type>AdGroupCriterion</AdGroupCriterion.Type> </value>* <value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi: type="BiddableAdGroupCriterion"> <adGroupId>2035225096</adGroupId> <criterion xsi:type="Keyword"> <id>400288707</id> <type>KEYWORD</type> <Criterion.Type>Keyword</Criterion.Type> <text>venus cruise</text> <matchType>BROAD</matchType> </criterion> <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion. Type> <userStatus>ENABLED</userStatus> <systemServingStatus>ELIGIBLE</systemServingStatus> <approvalStatus>APPROVED</approvalStatus> <biddingStrategyConfiguration> <biddingStrategyType>MANUAL_CPC</biddingStrategyType> <biddingStrategySource>CAMPAIGN</biddingStrategySource> <biddingScheme xsi:type="ManualCpcBiddingScheme"> <BiddingScheme.Type>ManualCpcBiddingScheme</BiddingScheme.Type > <enhancedCpcEnabled>true</enhancedCpcEnabled> </biddingScheme> <bids xsi:type="CpcBid"> <Bids.Type>CpcBid</Bids.Type> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>530000</microAmount> </bid> <cpcBidSource>ADGROUP</cpcBidSource> </bids> </biddingStrategyConfiguration> </value> *<value> <AdGroupCriterion.Type>AdGroupCriterion</AdGroupCriterion.Type> </value>* <partialFailureErrors xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:type="CriterionError"> <fieldPath>*operations[1].operand.criterion.text*</fieldPath> <trigger>inv@lid cruise</trigger> <errorString>CriterionError.KEYWORD_HAS_INVALID_CHARS< /errorString> <ApiError.Type>CriterionError</ApiError.Type> <reason>KEYWORD_HAS_INVALID_CHARS</reason> </partialFailureErrors> <partialFailureErrors xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:type="CriterionError"> <fieldPath>*operations[3].operand.criterion.text*</fieldPath> <trigger>b(a)d keyword cruise</trigger> <errorString>CriterionError.KEYWORD_HAS_INVALID_CHARS< /errorString> <ApiError.Type>CriterionError</ApiError.Type> <reason>KEYWORD_HAS_INVALID_CHARS</reason> </partialFailureErrors> </rval> </mutateResponse> </soap:Body> </soap:Envelope> -----------------END API CALL----------------------- On Tuesday, January 20, 2015 at 4:11:27 AM UTC-8, Oliver wrote: > > Thanks Anash. > > Just to confirm, when you say: > >> But the failed operations will not have a valid ad field or ids. > > Do you mean there will be a NULL in the position of the failed Ad, or do > you mean there will be an AdGroupAd with invalid Ad ID (maybe something > like 0)? > > > > On Tuesday, January 20, 2015 at 11:39:57 AM UTC, Anash P. Oommen (AdWords > API Team) wrote: >> >> Hi Oliver, >> >> All the operations (failed and successful) will be returned in the >> results, in the same order as you passed them to the server. But the failed >> operations will not have a valid ad field or ids. You can use either that >> information, or lookup the errors to see which operations failed and why. >> >> Cheers, >> Anash P. Oommen, >> AdWords API Advisor. >> >> >> On Tuesday, January 20, 2015 at 12:33:52 AM UTC-8, Oliver wrote: >>> >>> Thanks Anash. >>> >>> I forgot to mention we have partialFailure enabled. We're also aware of >>> how to find out about the failed operations as you pointed out in the >>> examples. >>> >>> Our question was about how to handle the successful operations returned >>> result. We need to know the ID of the new ads that were successfully >>> created. We get an *AdGroupAd*[] array from >>> *AdGroupAdReturnValue.getValue() >>> *which has this data. However, we're not sure how the data is >>> positioned there. >>> >>> In the example I gave, if the 3 failed Ads are not in that array, then >>> how do we know which 7 Ads succeeded (since the array position will be >>> different from the operation position). >>> >>> However, if the array is 10 objects long, then what value do you provide >>> for the failed Ads? >>> >>> >>> Oliver >>> >>> >>> >>> >>> On Tuesday, January 20, 2015 at 4:03:03 AM UTC, Anash P. Oommen (AdWords >>> API Team) wrote: >>>> >>>> Hi Oliver, >>>> >>>> The behavior is controlled by an AdWords API SOAP header called >>>> partialFailure. If you disable partialFailure, then the whole request >>>> fails >>>> if at least one operation fails (this is the default). If you enable >>>> partial failure, the failed operations will be returned in a separate >>>> field >>>> of the results, and you can look at the error fieldPath to figure out the >>>> index of the failed operation. See >>>> https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/v201409/ErrorHandling/HandlePartialFailures.cs >>>> >>>> for an example. >>>> >>>> Cheers, >>>> Anash P. Oommen, >>>> AdWords API Advisor. >>>> >>>> On Monday, January 19, 2015 at 9:53:17 PM UTC+5:30, Oliver wrote: >>>>> >>>>> Assume we want to create 10 new text Ads. >>>>> >>>>> We use *AdGroupAd.mutate()* and pass the 10 *AdGroupAdO**peration * >>>>> objects. The response from the mutate method is an >>>>> *AdGroupAdReturnValue *object. >>>>> >>>>> Assume the creation of 3 out of the 10 Ads failed (Policy violation, >>>>> etc.) >>>>> >>>>> How long is the *AdGroupAd*[] array that is returned by >>>>> *AdGroupAdReturnValue,getValue()*? >>>>> >>>>> If it's 10, what is returned for the Ads that failed to be created? >>>>> >>>>> If it's 7, how do we know which Ads these 7 are? >>>>> >>>>> >>>>> Thanks >>>>> >>>>> Oliver >>>>> >>>>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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]. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/9622ac1b-f9f3-4282-81ab-2cfe0d563749%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
