$adgroupid = 567567; $xid = 346346;
$adWordsServices = new AdWordsServices(); $currentService = $adWordsServices->get($this->aw_session, AdGroupAdService::class);
$operations = [];
$ad = new ResponsiveDisplayAd(); $ad->setId($xid);
$ad->setShortHeadline("New Short Headline Updated");
// Create ad group ad. $adGroupAd = new AdGroupAd(); $adGroupAd->setAdGroupId($adgroupid); $adGroupAd->setAd($ad);
// Update the status to PAUSED. $adGroupAd->setStatus(AdGroupAdStatus::PAUSED);
// Create ad group ad operation and add it to the list. $operation = new AdGroupAdOperation(); $operation->setOperand($adGroupAd); $operation->setOperator(Operator::SET); $operations[] = $operation;
// Pause the ad on the server. $result = $currentService->mutate($operations);
AdError.CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR
HTTP/1.1 500 Internal Server ErrorContent-Type: text/xml; charset=UTF-8Date: Thu, 08 Mar 2018 07:24:56 GMTExpires: Thu, 08 Mar 2018 07:24:56 GMTCache-Control: private, max-age=0X-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINX-XSS-Protection: 1; mode=blockServer: GSEAlt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="41,39,35"Accept-Ranges: noneVary: Accept-EncodingConnection: close
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201710"><requestId>000566e19293c5d00a621747e70bb148</requestId><serviceName>AdGroupAdService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>199</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>[AdError.CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR @ operations[0].operand.ad]</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201710"><message>[AdError.CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR @ operations[0].operand.ad]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AdError"><fieldPath>operations[0].operand.ad</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>ad</field></fieldPathElements><trigger></trigger><errorString>AdError.CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR</errorString><ApiError.Type>AdError</ApiError.Type><reason>CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>