Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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
Community 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?

Avatar

Correct answer by
Community 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

Community 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.

@Arun_Patidar , please correct me.