I also tried to update a single asset in this way, but received an error:
def update_asset_group_headlines(self, account_id, new_text,
asset_resource_name):
asset_group_service = self.get_service("AssetGroupAssetService")
asset_group_asset_operation =
self.get_type("AssetGroupAssetOperation")
asset = asset_group_asset_operation.update
asset.resource_name = asset_resource_name
asset.asset = new_text
asset.field_type =
self.get_type('AssetFieldTypeEnum').AssetFieldType.HEADLINE
fm = protobuf_helpers.field_mask(None, asset._pb)
asset_group_asset_operation.update_mask.CopyFrom(fm)
asset_group_service.mutate_asset_group_assets(
customer_id=account_id, operations=[asset_group_asset_operation]
)
Method:
/google.ads.googleads.v10.services.AssetGroupAssetService/MutateAssetGroupAssets
Host: googleads.googleapis.com
Headers: {
"developer-token": "REDACTED",
"login-customer-id": "4128782957",
"x-goog-api-client": "gl-python/3.7.3 grpc/1.46.1 gax/2.7.1 gccl/16.0.0",
"x-goog-request-params": "customer_id=1489840023"
}
Request: customer_id: "1489840023"
operations {
update {
resource_name:
"customers/1489840023/assetGroupAssets/6442638580~40330218621~HEADLINE"
asset: "Eigen voorraad van Autohero"
field_type: HEADLINE
}
update_mask {
paths: "resource_name"
paths: "asset"
paths: "field_type"
}
}
Response
-------
Headers: {
"google.ads.googleads.v10.errors.googleadsfailure-bin":
"\nb\n\u0002\b\u000b\u00127Field 'asset' cannot be modified by 'UPDATE'
operation.\"#\u0012\u000e\n\noperations\u0018\u0000\u0012\b\n\u0006update\u0012\u0007\n\u0005asset\u0012\u00160ZvGNEeQOLJxdd6uSMhoPw",
"grpc-status-details-bin": "\b\u0003\u0012%Request contains an invalid
argument.\u001a\u0001\nDtype.googleapis.com/google.ads.googleads.v10.errors.GoogleAdsFailure\u0012|\nb\n\u0002\b\u000b\u00127Field
'asset' cannot be modified by 'UPDATE'
operation.\"#\u0012\u000e\n\noperations\u0018\u0000\u0012\b\n\u0006update\u0012\u0007\n\u0005asset\u0012\u00160ZvGNEeQOLJxdd6uSMhoPw",
"request-id": "0ZvGNEeQOLJxdd6uSMhoPw"
}
Fault: errors {
error_code {
request_error: IMMUTABLE_FIELD
}
message: "Field \'asset\' cannot be modified by \'UPDATE\' operation."
location {
field_path_elements {
field_name: "operations"
index: 0
}
field_path_elements {
field_name: "update"
}
field_path_elements {
field_name: "asset"
}
}
}
request_id: "0ZvGNEeQOLJxdd6uSMhoPw"
On Monday, July 4, 2022 at 10:20:58 AM UTC+2 Gionni Lone wrote:
> Hi, thank you for your reply.
> I know the maximum number I can have per asset is 5, but what I want to do
> is replacing them. With RSA when I wanted to replace them I would just
> upload other 15 headlines and they get correctly replaced, but in this case
> it says "exceeded the limit". Can you please tell me whats the correct way
> of replacing those assets?
>
> Thank you
>
> On Friday, July 1, 2022 at 5:12:06 PM UTC+2 adsapi wrote:
>
>> Hi Gionni,
>>
>> Thank you for raising this concern to the Google Ads API Forum.
>>
>> Upon checking the provided logs, I can see that you are encountering the
>> headline limit for asset groups. According to this document
>> <https://support.google.com/google-ads/answer/10724748#zippy=%2Ctext-specifications>,
>>
>> you can only add up to 5 headlines for the asset group. However, upon
>> checking the counts of linked headlines to your asset group using the query
>> below, I can see that you already exceeded the limit. This is the possible
>> reason why the error persists.
>>
>> SELECT asset.id, asset_group_asset.status FROM asset_group_asset WHERE
>> asset_group.resource_name = \"customers/1489840023/assetGroups/6442638580\"
>> AND asset_group_asset.field_type ="HEADLINE"
>>
>> Best regards,
>> [image: Google Logo]
>> Jinky
>> Google Ads API Team
>>
>>
>> ref:_00D1U1174p._5004Q2cFIxw:ref
>>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/29675c9c-f26d-4655-8b72-f5dd79397810n%40googlegroups.com.