AdError.AD_TYPE_MISMATCH for different ads then ExpentedTextAd

44 views
Skip to first unread message

Łukasz Stankiewicz

unread,
May 8, 2019, 5:07:05 PM5/8/19
to AdWords API and Google Ads API Forum
Hello,
When i try SET values on ResponsiveDisplayAd i get AdError.AD_TYPE_MISMATCH

[2019-05-08 15:21:07] AW_SOAP.INFO: clientCustomerId=6110478927 operations=1 service=MediaService method=upload responseTime=431 requestId=0005886034b84b3f0a0125d0f90a0df2 server=adwords.google.com isFault=0 faultMessage=  
[2019-05-08 15:21:09] AW_SOAP.WARNING: clientCustomerId=6110478927 operations=1 service=AdService method=mutate responseTime=274 requestId=0005886034dd430f0a01a305a202d870 server=adwords.google.com isFault=1 faultMessage=[AdError.AD_TYPE_MISMATCH @ operations[0].operand.id]  
[2019-05-08 15:21:09] AW_SOAP.NOTICE: POST /api/adwords/cm/v201809/AdService?wsdl HTTP/1.1
Connection: close
User-Agent: PHP-SOAP/7.2.17-0ubuntu0.18.04.1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 1179
Authorization: REDACTED

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header><ns1:RequestHeader><ns1:clientCustomerId>6110478927</ns1:clientCustomerId><ns1:developerToken>REDACTED</ns1:developerToken><ns1:userAgent>unknown (AwApi-PHP, googleads-php-lib/41.0.0, PHP/7.2.17-0ubuntu0.18.04.1)</ns1:userAgent><ns1:validateOnly>false</ns1:validateOnly><ns1:partialFailure>false</ns1:partialFailure></ns1:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1:mutate><ns1:operations><ns1:operator>SET</ns1:operator><ns1:operand xsi:type="ns1:ResponsiveDisplayAd"><ns1:id>347328833020</ns1:id><ns1:finalUrls>http://www.example.com/</ns1:finalUrls><ns1:finalMobileUrls>http://www.example.com/mobile</ns1:finalMobileUrls><ns1:marketingImage><ns1:mediaId>13111573143</ns1:mediaId></ns1:marketingImage><ns1:shortHeadline>asds</ns1:shortHeadline><ns1:longHeadline>asds</ns1:longHeadline><ns1:description>asds</ns1:description></ns1:operand></ns1:operations></ns1:mutate></SOAP-ENV:Body></SOAP-ENV:Envelope>

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Date: Wed, 08 May 2019 13:21:08 GMT
Expires: Wed, 08 May 2019 13:21:08 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: quic=":443"; ma=2592000; v="46,44,43,39"
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809"><requestId>0005886034dd430f0a01a305a202d870</requestId><serviceName>AdService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>274</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>[AdError.AD_TYPE_MISMATCH @ operations[0].operand.id]</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201809"><message>[AdError.AD_TYPE_MISMATCH @ operations[0].operand.id]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AdError"><fieldPath>operations[0].operand.id</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>id</field></fieldPathElements><trigger></trigger><errorString>AdError.AD_TYPE_MISMATCH</errorString><ApiError.Type>AdError</ApiError.Type><reason>UNKNOWN</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>
  
PHP Fatal error:  Uncaught Google\AdsApi\AdWords\v201809\cm\ApiException: [AdError.AD_TYPE_MISMATCH @ operations[0].operand.id] in /home/lukasz-stankiewicz/Development/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:43
Stack trace:
#0 /home/lukasz-stankiewicz/Development/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php(43): ReflectionClass->newInstanceArgs(Array)
#1 /home/lukasz-stankiewicz/Development/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(203): Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', Array)
#2 /home/lukasz-stankiewicz/Development/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(165): Google\AdsApi\Common\AdsSoapClient->parseApiExceptionFromSoapFault(Object(SoapFault))
#3 /home/lukasz-stankiewicz/Development/googleads-php-lib/src/Google/AdsApi/AdWords/v201809/cm/AdService.php(191): Google\AdsApi\Common\AdsSoapClient->__soapCall('mutate', Array)
#4 /home/lukasz-stankiewicz/Development/googleads-php-lib/examples/AdWords/v201809/B in /home/lukasz-stankiewicz/Development/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php on line 43

googleadsapi...@google.com

unread,
May 9, 2019, 9:51:50 AM5/9/19
to lukas.st...@gmail.com, AdWords API and Google Ads API Forum
Hello!

Thanks for reaching out with this information, I'm taking a look into the problem and will follow up with more information as soon as possible.

Best,
Ben Karl, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/bce06f42-a083-45cb-9cfe-0cf7e87a1e63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

googleadsapi...@google.com

unread,
May 10, 2019, 4:38:55 PM5/10/19
to lukas.st...@gmail.com, AdWords API and Google Ads API Forum
Hello,

I took a quick look into this. The code is using a ResponsiveDisplayAd object, but the ad ID being referenced is a MultiAssetResponsiveDisplayAd. Please change the object type in the code and it should work. The error was saying that the wrong ad type was being used, and didn't match the ad ID.

Hope that helps!

Best,
Ben, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Reply all
Reply to author
Forward
0 new messages