I can' t create new ad Image myImage = new Image(); var operations = new List<AdGroupAdOperation>(); var adService = (AdGroupAdService)user.GetService(AdWordsService.v201502.AdGroupAdService); myImage.sourceUrl = "http://s019.radikal.ru/i621/1507/7f/40afb4bf93d3.jpg"; var templateAd = new TemplateAd { name = "Banner", displayUrl = "http://www.example.ru", url = "http://www.example.ru", templateId = 432, dimensions = new Dimensions { height = 50, width = 320 }, adAsImage = myImage, templateElements = new[] { new TemplateElement { uniqueName = "adData", fields = new[] { new TemplateElementField { name = "appStore", type = TemplateElementFieldType.ENUM, fieldText = "1"//"1,2,4" }, new TemplateElementField { name = "appId", type = TemplateElementFieldType.TEXT, fieldText = "1" } } } } }; AdGroupAd AdGroupAd = new AdGroupAd(); AdGroupAd.adGroupId = adGroupId; AdGroupAd.ad = templateAd; AdGroupAdOperation operation = new AdGroupAdOperation(); operation.@operator = Operator.ADD; operation.operand = AdGroupAd; operation.operand.ad.url = "http://example.ru"; AdGroupAdReturnValue adRetval = adService.mutate( new AdGroupAdOperation[] { operation }); AdGroupAd newAd = adRetval.value[0];
I get Exception: {"[AdError.CANNOT_SET_FIELD @ operations[0].operand.ad.url, AdError.CANNOT_SET_WITH_FINAL_URLS @ operations[0].operand.ad.url, NullError.NULL_CONTENT @ operations[0].operand.ad.adAsImage]"} -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@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 --- 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 adwords-api+unsubscr...@googlegroups.com. 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/1b2e2e57-55ed-4d2c-bcfa-59bc54a74bad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.