Error during creation of ads - CANNOT_SET_FIELD - URL - V201502

160 views
Skip to first unread message

Assaf Frank

unread,
Jul 14, 2015, 9:39:13 AM7/14/15
to adwor...@googlegroups.com
Hi,

My creation of ads worked properly a week ago and now , for some reason, I can't create ads.
Is this due to the last changed in upgraded URLs etc ?

I do set all parameters -

                    AdWordsServices adwordsServices = new AdWordsServices();
   // Get the CampaignService.
   AdGroupAdServiceInterface adGroupAdService = adwordsServices.get(session, AdGroupAdServiceInterface.class);
    
     long adGroupId = Long.parseLong(pAdGroupID);

     // Create ad group ad.
     AdGroupAd textAdGroupAd = new AdGroupAd();
     textAdGroupAd.setAdGroupId(adGroupId);
    
     textAdGroupAd.setStatus(pStatus);
     
      TextAd textAd = new TextAd();
      textAd.setHeadline(pHeadline);
      textAd.setDescription1(pDescription1);
      textAd.setDescription2(pDescription2);
      textAd.setDisplayUrl(pDisplayURL);
      textAd.setUrl(pURL);
 
      textAdGroupAd.setAd(textAd);

     // Create operations.
     AdGroupAdOperation textAdGroupAdOperation = new AdGroupAdOperation();
     textAdGroupAdOperation.setOperand(textAdGroupAd);      textAdGroupAdOperation.setOperator(Operator.ADD);

     AdGroupAdOperation[] operations = new AdGroupAdOperation[] {textAdGroupAdOperation};       
     // Add ads.
     AdGroupAdReturnValue result = adGroupAdService.mutate(operations);

The error I get is: 

faultString: [AdError.CANNOT_SET_FIELD @ operations[0].operand.ad.url]
 faultActor: 
 faultNode: 
 faultDetail: 
{https://adwords.google.com/api/adwords/cm/v201502}ApiExceptionFault:<message>[AdError.CANNOT_SET_FIELD @ operations[0].operand.ad.url]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AdError"><fieldPath>operations[0].operand.ad.url</fieldPath><trigger/><errorString>AdError.CANNOT_SET_FIELD</errorString><ApiError.Type>AdError</ApiError.Type><reason>CANNOT_SET_FIELD</reason></errors>

[AdError.CANNOT_SET_FIELD @ operations[0].operand.ad.url]

Thanks,



Umesh Dengale

unread,
Jul 14, 2015, 2:11:26 PM7/14/15
to adwor...@googlegroups.com, as...@easyleads.com
Hello,

Please use textAd.setFinalUrls() method instead of textAd.setUrl(). Check out our AdTextAds example in the Java client library. 

Thanks,
Umesh, AdWords API Team.

William Perrello

unread,
Jul 24, 2015, 8:58:33 AM7/24/15
to AdWords API Forum, as...@easyleads.com, adwordsapia...@google.com
umesh - my info tells me that this change should not be necessary until the demise of the 201409 API which is supposed to be supported till next tuesday.  Did it get demised early?  

Umesh Dengale

unread,
Jul 24, 2015, 11:07:32 AM7/24/15
to AdWords API Forum, bper...@gmail.com, as...@easyleads.com, bper...@gmail.com
Hello,

The sunset date for v201409 is 07/28/2015. Above mentioned changes(Final URL) are applicable to V201409. Please check out the AdTextAds example (v201409) in the Java client library.
Reply all
Reply to author
Forward
0 new messages