Cant update responsive search ad - v16

215 views
Skip to first unread message

silvio arcich

unread,
Mar 8, 2024, 11:36:35 AM3/8/24
to Google Ads API and AdWords API Forum
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

Google Ads API Forum Advisor

unread,
Mar 8, 2024, 2:08:51 PM3/8/24
to arcich...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

After reviewing your concern, I understand that you are encountering the UNKNOWN error while updating the responsive search ads via the Google Ads API.

In order to assist you further, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end, as the error stack trace you provided is not enough for us to further investigate.

As it appears that you are using the PHP client library, if you haven't enabled the logging yet, I would request you to enable it by referring to this guide PHP.

You can send the details via Reply privately to the author option, or direct private reply to this email.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02rzo01:ref"

Thanks,
 
Google Logo Google Ads API Team


余涛

unread,
May 29, 2024, 4:53:15 AM5/29/24
to Google Ads API and AdWords API Forum
Hello,
Has the issue been resolved? I also encountered the same problem.

Google Ads API Forum Advisor

unread,
May 29, 2024, 10:13:07 AM5/29/24
to jintao....@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

I understand that you are encountering the UNKNOWN error. To troubleshoot your issue, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.


You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02rzo01:ref" (ADR-00226594)


Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages