I'm using the Adwords PHP SDK, trying to update fields of MultiAssetResponsiveDisplayAds. In this test, I'm just trying to update the long headline. The error I get is that I'm not setting all the other fields, but I don't want to change any other field. Sample code below and error output as well.
Code:
$adService = $adWordsServices->get($session, AdService::
class);
$multiAssetResponsiveDisplayAd =
new MultiAssetResponsiveDisplayAd();
$multiAssetResponsiveDisplayAd->setId($ad_id);
$longHeadlineTextAsset =
new TextAsset();
$long_headline =
'New Long Headline';
$longHeadlineTextAsset->setAssetText($long_headline);
$multiAssetResponsiveDisplayAd->setLongHeadline(
new AssetLink($longHeadlineTextAsset));
$operation =
new AdOperation();
$operation->setOperand($multiAssetResponsiveDisplayAd);
$operation->setOperator(Operator::
SET);
$operations[] = $operation;
// Updates the ad on the server.
$result = $adService->mutate($operations);
$updatedAd = $result->getValue()[0];
return "Ad Has been Updated";
Error Message:
CollectionSizeError.TOO_FEW @ operations[0].operand.headlines, CollectionSizeError.TOO_FEW @ operations[0].operand.descriptions, RequiredError.REQUIRED @ operations[0].operand.marketingImages, RequiredError.REQUIRED @ operations[0].operand.squareMarketingImages, AdError.EMPTY_FIELD @ operations[0].operand.finalUrls