Skip to main content
Level 2
Nov 10, 2022 12:40 PM UTC
Solved

curl command to rename and move the asset

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
krati_garg
krati_gargAccepted solution
Adobe Employee
Nov 13, 2022 1:40 PM UTC

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"

4 replies

krati_garg
Adobe Employee
Adobe Employee
Nov 10, 2022 1:44 PM UTC

@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"

Translate
gojo1Author
Level 2
Nov 10, 2022 2:11 PM UTC

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

Translate
krati_garg
Adobe Employee
Adobe Employee
Nov 10, 2022 2:19 PM UTC

Took the command from here: 

https://experienceleague.adobe.com/docs/experience-manager-65/assets/extending/mac-api-assets.html?lang=en#move-a-folder-or-asset

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"

Translate