We tried to add new ImageAds using by the GoogleAds API Ver 2.2.0.

We used the below code :
```
$imageAdInfo = new ImageAdInfo([
    'data' => new BytesValue(['value' => file_get_contents($image)]),
]);

$ad = new Ad([
    'image_ad'   => $imageAdInfo,
    'final_urls' => [
        new StringValue(['value' => $urlFinal]),
    ],
]);

$adGroupAd = new AdGroupAd([
    'ad_group' => $adGroupResourceName,
    'status'   => AdGroupAdStatus::ENABLED,
    'ad'       => $ad,
]);

$operationAdd = new AdGroupAdOperation();
$operationAdd->setCreate($adGroupAd);
$operations[] = $operationAdd;

…

$adGroupAdService->mutateAdGroupAds(GOOGLE_ADS_CUSTOMER_ID, $operations);
```

However, we got the following error message from API:
```
google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: 
"/google.ads.googleads.v2.services.AdGroupAdService/MutateAdGroupAds", 
ClientCustomerId: XXXXXXX, RequestId: "XXXXXXXX", IsFault: 1, FaultMessage: 
"["The required field was not present.","A required field was not specified 
or is an empty string."]"
```

So, we want to know the required fields to add the new ImageAd.
However, we couldn't find the information about this.

Could you please tell us the required fields in the above case?

Best Regards.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e58d46a2-7ce2-49a3-9417-d56dc0cd456c%40googlegroups.com.

Reply via email to