Hi team, i have this error:
Fatal error: Uncaught Google\ApiCore\ApiException: { "message": "Request
contains an invalid argument.", "code": 3, "status": "INVALID_ARGUMENT",
"details": [ { "@type":
"type.googleapis.com\/google.ads.googleads.v16.errors.GoogleAdsFailure",
"errors": [ { "errorCode": { "requestError": "UNKNOWN" }, "message": "The
error code is not in this version.", "location": { "fieldPathElements": [ {
"fieldName": "operations", "index": 0 }, { "fieldName": "update" }, {
"fieldName": "resource_name" } ] } } ], "requestId":
"Qdt67dMt4bU2pcE2C67lig" } ] } thrown in
/var/www/html/spicytool/v16/vendor/google/gax/src/ApiException.php on line
267
This is my code:
use Google\Ads\GoogleAds\V16\Common\ResponsiveSearchAdInfo;
$ad = new Ad([
'resource_name' => ResourceNames::forAd($customerId, $adId),
'final_urls' => [$finalUrls],
'final_mobile_urls' => [$finalUrls],
'responsive_search_ad' => new ResponsiveSearchAdInfo([
// Update some properties of the responsive search ad.
'headlines' => [
new AdTextAsset([
'text' => 'Cruise to Pluto 1' ,
'pinned_field' => ServedAssetFieldType::HEADLINE
]),
new AdTextAsset([
'text' => 'Cruise to Pluto 2' ,
'pinned_field' => ServedAssetFieldType::HEADLINE_1
]),
new AdTextAsset([
'text' => 'Cruise to Pluto 3' ,
'pinned_field' => ServedAssetFieldType::HEADLINE_2
]),
],
'descriptions' => [
new AdTextAsset(['text' => 'Best space cruise ever.']),
new AdTextAsset([
'text' => 'The most wonderful space experience you will ever have.'])
]
]),
]);
$adOperation = new AdOperation();
$adOperation->setUpdate($ad);
$adOperation->setUpdateMask(FieldMasks::allSetFieldsOf($ad));
$response = $adServiceClient->mutateAds(MutateAdsRequest::build($customerId,
[$adOperation]));
I take this example
from:
https://developers.google.com/google-ads/api/samples/update-responsive-search-ad#php
I think is something with ResponsiveSearchAdInfo method, because if i take
off this parameter, the final_urls was updated successfully.
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/e55d604f-02a1-4280-9114-38e1c4f51ed3n%40googlegroups.com.