curl command to rename and move the asset | Community
Skip to main content
Level 2
November 10, 2022
Solved

curl command to rename and move the asset

  • November 10, 2022
  • 1 reply
  • 2448 views

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.
Best answer by krati_garg

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"

1 reply

krati_garg
Adobe Employee
Adobe Employee
November 10, 2022

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

gojo1Author
Level 2
November 10, 2022

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

krati_garg
Adobe Employee
Adobe Employee
November 10, 2022

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"