Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

bulk operation

Avatar

Level 3

Hi,

I want to perform CRUD bulk operation on asset with a single action via API call using postman. 

How can this be achieved?

 Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

1. We can achieve this using AEM servlet(post request) via postman .

    Steps are defined here https://aem4beginner.blogspot.com/access-aem-servlet-in-postman

     and we need to add custom logic to perform bulk operation in that servlet.

 

2. We can use groovy script to perform bulk operation.

 

Are you planning to publish assets after CRUD bulk operation?

 

 

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,

What kind of operations are you planning to perform? Could you please explain with examples?



Arun Patidar

Avatar

Correct answer by
Employee Advisor

1. We can achieve this using AEM servlet(post request) via postman .

    Steps are defined here https://aem4beginner.blogspot.com/access-aem-servlet-in-postman

     and we need to add custom logic to perform bulk operation in that servlet.

 

2. We can use groovy script to perform bulk operation.

 

Are you planning to publish assets after CRUD bulk operation?

 

 

Avatar

Employee Advisor

I have tried to execute below operation on asset from postman-

Update asset metadata

Updates the asset metadata properties. If you update any property in the dc: namespace, the API updates the same property in the jcr namespace. The API does not sync the properties under the two namespaces.

Request: PUT /api/assets/myfolder/myAsset.png -H"Content-Type: application/json" -d '{"class":"asset", "properties":{"jcr:title":"My Asset"}}'

 

Here is my postman entries with status code:200 -

 

DEBAL_DAS_1-1649870600551.png

property got added at jcr:content node as shown below -

DEBAL_DAS_2-1649870675493.png

 

Here I am able to update only one asset.

To perform bulk CRUD operation, I feel we can have custom logic to perform bulk operation from servlet if it is essential to use postman.

@arunpatidar , please correct me.

 

Avatar

Community Advisor

Yeah that's true but for bulk operations following can be explored and API can be checked to do bulk operations

https://experienceleague.adobe.com/docs/experience-manager-64/assets/managing/managing-multiple-asse...

 



Arun Patidar