Hello,
I'm using v201209 .NET Client Libraries with the ClientId 186-121-2518 (
which is a Test Account ).
The publishing of basic TextAds and ImageAds went ok, but when I try to
create a TemplateAd ( templateId = 190, "Image Search Ad" ),
the sevice responds with: USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE
( The user does not have permissions to create a template ad for the given
template. )
This is a limitation for a TestAccount, or I'm doing something wrong?
Here's a snippet:
var newAd = new v201209.Ad();
>
// create the ad image
> var adImage = new Image();
> adImage.data = MiscUtil.ResizeImage(creative.ImageData, 160, 160,
> ImageFormat.Jpeg);
> var templateAdElement = new TemplateElement();
> templateAdElement.uniqueName = "adData";
> templateAdElement.fields = new TemplateElementField[]
> {
> new TemplateElementField
> {
> name = "headline",
> type = TemplateElementFieldType.TEXT,
> fieldText = GetAdDescription(creative.Title, true, 25)
> },
> new TemplateElementField
> {
> name = "description1",
> type = TemplateElementFieldType.TEXT,
> fieldText = GetAdDescription(creative.Description, true, 25)
> },
> new TemplateElementField
> {
> name = "description2",
> type = TemplateElementFieldType.TEXT,
> fieldText = GetAdDescription(creative.Description, false, 25)
> },
> new TemplateElementField
> {
> name ="inlineImage",
> type = TemplateElementFieldType.IMAGE,
> fieldMedia = adImage
> }
> };
> newAd = new TemplateAd
> {
> templateId = 190,
> name = creative.Title,
> templateElements = new TemplateElement[] {templateAdElement},
> displayUrl = creative.DisplayedUrl,
> url = creative.Url
> };
>
>
> AdGroupAd adGroupAd = null;
> if (isChanging)
> {
> adGroupAd = new AdGroupAd { adGroupId = adWordsAdGroupId, ad = newAd,
> status = AdGroupAdStatus.ENABLED };
> adGroupAd.ad.id = adWordsAdGroupAdId;
> }
> else
> {
> adGroupAd = new AdGroupAd { adGroupId = adWordsAdGroupId, ad = newAd,
> status = AdGroupAdStatus.ENABLED };
> }
> var adOperation = new AdGroupAdOperation {@operator = Operator.ADD};
> if (isChanging)
> adOperation.@operator = Operator.SET;
> adOperation.operand = adGroupAd;
> operations.Add(adOperation);
> try
> {
> AdGroupAdReturnValue returnValue = adService.mutate(operations.ToArray());
> if (returnValue != null && returnValue.value != null &&
> returnValue.value.Length > 0)
> return returnValue.value[0].ad.id;
> }
> catch (Exception ex)
> {
> throw new System.ApplicationException("Error adding new Ad.", ex);
> }
Thank you.
Cristi
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/groups/opt_out.