Expand my Community achievements bar.

SOLVED

curl command to rename and move the asset

Avatar

Level 2

I want to rename and move an asset through curl there are 700+ assets to work on, can anyone help on the best way to do this one. I want to change the name of these assets like how we get the change of asset when move operation is performed.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Took the command from here: 

https://experienceleague.adobe.com/docs/experience-manager-65/assets/extending/mac-api-assets.html?l...

You can switch to documentation, whichever version of AEM you are using.
Also, you might be running your curl command with some other user credentials than "admin"

View solution in original post

4 Replies

Avatar

Employee Advisor

@gojo1 In my opinion, below is the best way for bulk renaming and moving of Assets:
-Get a List of Assets
-Write a shell script, reading those assets and executing the curl command (reference below)

https://chintalapudi4.medium.com/aem-dam-bulk-metadata-update-using-curl-6049c60fe96a



Renaming and Moving of an asset can be taken care in a single command:
curl -u admin:admin -X MOVE https://[aem_server]:[port]/api/assets/source/file.png -H "X-Destination: https://[aem_server]:[port]/api/assets/destination/file.png" -H "X-Overwrite: T"

Avatar

Level 2

Renaming and Moving of an asset can be taken care in a single command:
curl -u admin:admin -X MOVE https://[aem_server]:[port]/api/assets/source/file.png -H "X-Destination: https://[aem_server]:[port]/api/assets/destination/file.png" -H "X-Overwrite: T"

 

This one is not working when i am using this command no error no success nothing in the screen

Avatar

Level 1

Took the command from here: 

https://experienceleague.adobe.com/docs/experience-manager-65/assets/extending/mac-api-assets.html?l...

You can switch to documentation, whichever version of AEM you are using.
Also, you might be running your curl command with some other user credentials than "admin"

Avatar

Correct answer by
Employee Advisor

Took the command from here: 

https://experienceleague.adobe.com/docs/experience-manager-65/assets/extending/mac-api-assets.html?l...

You can switch to documentation, whichever version of AEM you are using.
Also, you might be running your curl command with some other user credentials than "admin"