Request with ID "jksvO9WJsAfBiMQHZPHNqg" failed with status "INVALID_ARGUMENT" and includes the following errors:
Error with message "The error code is not in this version.".
On field: operations
On field: update
On field: app_ad
On field: images
On field: asset
However, I have been using the same code since last October and never faced this kind of error. Does anybody know if something changed in the API or in the endpoint?
Here is a snippet of my code:
##############################################
# Creating new image #
##############################################
# Media service
media_file_service = client.get_service('MediaFileService', version='v2')
# Media operation service
media_file_operation = client.get_type('MediaFileOperation', version='v2')
# Create IMAGE media file
media_file_resource_name = create_image(client,customer_id,media_file_operation,image_id,media_file_service)
##############################################
# Creating new assets #
##############################################
#Asset service
asset_service = client.get_service('AssetService', version='v2')
# Asset operation service
asset_operation = client.get_type('AssetOperation', version='v2')
# Mutate Image asset - Create
asset_resource_name = mutate_image_create(client,customer_id,asset_operation,media_file_resource_name,asset_service,image_id)
print('Uploading ....')
print('Image: %s\n'%(asset_resource_name))
################################################
# Image Assets Update
################################################
#Including new video in the list of videos to be assigned to the ad group ad
images_list.append(asset_resource_name)
##############################################
# Ad . #
##############################################
# Update Ad
ad_operation = client.get_type('AdOperation', version='v2')
ad = ad_operation.update
ad.resource_name = ad_service.ad_path(customer_id, num_ad)
for asset in images_list:
print("Sending info to Google ads...")
image_asset = ad.app_ad.images.add()
image_asset.asset.value = asset
#==============================================
# Field Mask Update
#==============================================
fm = protobuf_helpers.field_mask(None, ad)
ad_operation.update_mask.CopyFrom(fm)