can't create TemplateAd anymore with API upgrade

44 views
Skip to first unread message

bgraves

unread,
Jun 29, 2011, 8:32:03 PM6/29/11
to AdWords API Forum
In my code, I'm creating a new TemplateAd and then setting it with the
same fields (just changing the destination URL) from another
TemplateAd. For some reason, it's throwing an exception on a
"videoId" field which isn't even in the original TemplateAd. Is this
field a requirement (even if it's an old TemplateAd that doesn't even
contain the field)? How do I set the videoId if I don't even know
what it is?

Here's my SOAP request:
-----------------BEGIN API CALL---------------------

Request
-------

POST /api/adwords/cm/v201008/AdGroupAdService
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 4.0.30319.1)
VsDebuggerCausalityData: uIDPozq+WZs+pj1Oqa4qoy3FAi0AAAAA
+vy1v2sWBUCqvWN6tqSyOCpHkFnfBUdFk18VKTMgstYACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: adwords.google.com
Content-Length: 2744
TimeStamp: Wed, 29 Jun 2011 17:04:23 GMT

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/
XMLSchema"><soap:Header><RequestHeader xmlns="https://
adwords.google.com/api/adwords/cm/v201008"><applicationToken>******</
applicationToken><authToken>******</authToken><developerToken>******</
developerToken></RequestHeader></soap:Header><soap:Body><mutate
xmlns="https://adwords.google.com/api/adwords/cm/
v201008"><operations><operator>ADD</
operator><operand><adGroupId>1545399245</adGroupId><ad
xsi:type="TemplateAd"><url>http://tracking.media.com/redirect/
Redirect.aspx?g_crID={creative}&amp;g_kw={keyword}
&amp;g_pcmt={placement}&amp;g_cnt={ifsearch:0}{ifcontent:1}</
url><displayUrl>youtube.com/BlahBlahBlah</
displayUrl><trademarkDisapproved>false</
trademarkDisapproved><Ad.Type>TemplateAd</Ad.Type><templateId>13</
templateId><templateElements><uniqueName>adData</
uniqueName><fields><name>adName</name><type>TEXT</
type><fieldText>YouTube Page - BlahBlahBlah</fieldText></
fields><fields><name>headline</name><type>TEXT</
type><fieldText>BlahBlahBlah Strategies</fieldText></
fields><fields><name>description1</name><type>TEXT</
type><fieldText>Blah Blah Blah</fieldText></
fields><fields><name>description2</name><type>TEXT</
type><fieldText>View Our Video Series Today!</fieldText></
fields><fields><name>channelName</name><type>TEXT</
type><fieldText>CleanMyCredit</fieldText></
fields><fields><name>imageUrl</name><type>URL</type><fieldText>http://
i4.ytimg.com/vi/S-NoUdY8izU/default.jpg</fieldText></
fields><fields><name>displayUrl</name><type>VISIBLE_URL</
type><fieldText>youtube.com/BlahBlahBlah</fieldText></
fields><fields><name>destinationUrl</name><type>URL</
type><fieldText>http://tracking.media.com/redirect/Redirect.aspx?
g_crID={creative}&amp;g_kw={keyword}&amp;g_pcmt={placement}
&amp;g_cnt={ifsearch:0}{ifcontent:1}</fieldText></fields></
templateElements><name>YouTube Page - BlahBlahBlah</name><duration>0</
duration></ad><status>ENABLED</status></operand></operations></
mutate></soap:Body></soap:Envelope>

Response
--------

X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=UTF-8
Date: Thu, 30 Jun 2011 00:04:23 GMT
Expires: Thu, 30 Jun 2011 00:04:23 GMT
Server: GSE
TimeStamp: Wed, 29 Jun 2011 17:04:23 GMT

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/"><soap:Header><ResponseHeader xmlns="https://
adwords.google.com/api/adwords/cm/
v201008"><requestId>e3f4d6f2c4a09887f8aab986c67e977d</
requestId><operations>1</operations><responseTime>317</
responseTime><units>40</units></ResponseHeader></
soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</
faultcode><faultstring>[AdError.MISSING_REQUIRED_TEMPLATE_FIELDS @
operations[0].operand.ad.templateElements[0].fields;
trigger:'videoId']</faultstring><detail><ApiExceptionFault
xmlns="https://adwords.google.com/api/adwords/cm/
v201008"><message>[AdError.MISSING_REQUIRED_TEMPLATE_FIELDS @
operations[0].operand.ad.templateElements[0].fields;
trigger:'videoId']</message><ApplicationException.Type>ApiException</
ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance"
xsi:type="AdError"><fieldPath>operations[0].operand.ad.templateElements[0].fields</
fieldPath><trigger>videoId</
trigger><errorString>AdError.MISSING_REQUIRED_TEMPLATE_FIELDS</
errorString><ApiError.Type>AdError</
ApiError.Type><reason>MISSING_REQUIRED_TEMPLATE_FIELDS</reason></
errors></ApiExceptionFault></detail></soap:Fault></soap:Body></
soap:Envelope>
-----------------END API CALL-----------------------

Anash P. Oommen

unread,
Jul 5, 2011, 3:43:36 AM7/5/11
to adwor...@googlegroups.com
Hi,

I don't think this is related to a version upgrade. The API error is complaining about missing template field "videoId".

Cheers,
Anash P. Oommen,
AdWords API Advisor.

bgraves

unread,
Jul 5, 2011, 5:32:31 PM7/5/11
to AdWords API Forum
Again, why is it giving me an error on videoId? Is this required in
the current API? How can I create a TemplateAd just like my existing
one that doesn't have a videoId? If I need a videoId, where do I get
it? Make one up???

On Jul 5, 12:43 am, "Anash P. Oommen" <anash.p.oom...@google.com>
wrote:

Anash P. Oommen

unread,
Jul 6, 2011, 2:34:08 AM7/6/11
to adwor...@googlegroups.com
Hi,

AdWords API doesn't allow you to upload videos, so you have to upload the video, get the videoId using MediaService and then use it. See http://code.google.com/p/google-api-adwords-php/source/browse/trunk/examples/v201101/AddAds.php for an example on how to add a video ad. http://code.google.com/p/google-api-adwords-php/source/browse/trunk/examples/v201101/GetAllVideos.php shows how to get a video id.

bgraves

unread,
Jul 6, 2011, 2:40:10 PM7/6/11
to AdWords API Forum
Yes, but my issue is the fact that I don't want or have a video. Why
does TemplateAd require one??

On Jul 5, 11:34 pm, "Anash P. Oommen" <anash.p.oom...@google.com>
wrote:
> Hi,
>
> AdWords API doesn't allow you to upload videos, so you have to upload the
> video, get the videoId using MediaService and then use it. Seehttp://code.google.com/p/google-api-adwords-php/source/browse/trunk/e...for
> an example on how to add a video ad.http://code.google.com/p/google-api-adwords-php/source/browse/trunk/e...shows

Anash P. Oommen

unread,
Jul 7, 2011, 5:07:42 AM7/7/11
to adwor...@googlegroups.com
Hi,

You are using template id 13, that's a Youtube promoted video (and hence the requirement for videoId). See http://code.google.com/apis/adwords/docs/appendix/templateads.html#pyv_ad for details.
Reply all
Reply to author
Forward
0 new messages