Problem re-uploading an ImageAsset

167 views
Skip to first unread message

Andre Tannus

unread,
May 17, 2019, 4:25:33 PM5/17/19
to AdWords API and Google Ads API Forum
Hi all, I'm posting this for the second time since the previous post seems to have vanished into oblivion. Apologies if it turns up.

I am having issues with re-uploading a previously REMOVED Asset.

I understand that in general you cannot mutate objects that have been set to REMOVED.

I also noticed that when I ImageAsset with previously existing image data, the API recognizes it returns the exact same Asset from the first upload.

Now, suppose have done the following:
  1. Uploaded a new ImageAsset, and got back an AssetId.
  2. Mutated that ImageAsset setting its AssetStatus to REMOVED.
And suppose I now wish to re-upload that image (say I removed it by mistake).


The first thing I trued was to mutate the Asset and SET AssetStatus to ENABLED, which naturally failed, although with an uninformative error message: UNEXPECTED_INTERNAL_API_ERROR

Next, I tried to simply re-upload the image. The API accepted it, but returned the AssetId of the previously uploaded file, with AssetStatus set to REMOVED.

Finally I tried to upload the image with a new AssetName, and here is where I got a funny error message, telling me to remove the existing asset before I can rename it.

Google\AdsApi\AdWords\v201809\cm\ApiException [ 0 ]: [AssetError{super=AssetError.CANNOT_MODIFY_ASSET_NAME @ operations[0].operand.assetName; trigger:'There is an existing asset that represents the same content as the asset to be added, but with a different name: the input asset has name '5cdeb8aeeaf5f'; and the existing asset has name ''. Remove the existing asset first if you would like to change the name of the asset.', reason=CANNOT_MODIFY_ASSET_NAME}]

Now, is setting the AssetStatus to REMOVED not enough to remove the Asset? Am I missing something here?

Thanks for your help.

Google Ads API Forum Advisor Prod

unread,
May 20, 2019, 3:33:19 AM5/20/19
to adwor...@googlegroups.com

Hi Andre,

Thanks for raising your concern.

With regard to changing the status of an asset, if the image asset was set as REMOVED before, I am afraid that it currently not possible to AdWords API to change back the status of an asset into ENABLED.



"Next, I tried to simply re-upload the image. The API accepted it, but returned the AssetId of the previously uploaded file, with AssetStatus set to REMOVED.

Finally I tried to upload the image with a new AssetName, and here is where I got a funny error message, telling me to remove the existing asset before I can rename it.
"

With regard to the second and third thing you did to use an existing image asset (which mentioned above), to further check, could you provide the complete SOAP request and response logs via Reply privately to author? I asked this information because if you are going to upload the asset details, whether the image asset is the same or not, the API will return a new asset and it will not be treated as existing asset.

Regards,
Ejay
Google Ads API Team



ref:_00D1U1174p._5001UApwsC:ref

Andre Tannus

unread,
May 22, 2019, 3:35:12 PM5/22/19
to AdWords API and Google Ads API Forum
Hi Ejay, I've put together some details for you.
 

With regard to changing the status of an asset, if the image asset was set as REMOVED before, I am afraid that it currently not possible to AdWords API to change back the status of an asset into ENABLED.


Right, this is generally expected, correct? But as we will see in Steps 3 and 9, this is not entirely correct.
 

I asked this information because if you are going to upload the asset details, whether the image asset is the same or not, the API will return a new asset and it will not be treated as existing asset.


Again, the samples bellow show that this is not the case. Uploading the same image invariably returns the same asset (same AssetId) or an error.


Steps 3 and 9 are the most confusing.

Please let me know if you need additional information.

Regards,

André
 



Google Ads API Forum Advisor Prod

unread,
May 23, 2019, 4:22:47 AM5/23/19
to adwor...@googlegroups.com

Hi André,

Thanks for your reply.

With regard on changing the status of an asset, you can no longer target it with any API calls.

For your issue on uploading new asset but treating them as existing asset, please provide the complete SOAP request and response logs via Reply privately to author as it will be very helpful in investigating the issue. If you haven't enabled the SOAP logging yet, kindly enable it by following this guide for PHP library supported by AdWords API.



Regards,
Ejay
Google Ads API Team



ref:_00D1U1174p._5001UApwsC:ref
Reply all
Reply to author
Forward
0 new messages