Hi Folks,
I am trying filter the content of adobe aem assets api to get only folders and skip files to check whether parent folder have any sub folder.
I am refereeing below url for adobe aem documentation regarding asset api :
https://experienceleague.adobe.com/docs/experience-manager-64/assets/extending/mac-api-assets.html?l...
Can anyone help me to know how to filter the content of asset api.
Thanks,
Sandeep
Solved! Go to Solution.
Views
Replies
Total Likes
I think for what you're after, you need query builder instead of Assets API.
You should get a JSON output with a list of all folders inside DAM:
Folder structure in DAM:
I have the below folder structure in my AEM Assets containing a parent folder ('my-assets') which again contains 3 assets and 1 folder:
The Assets API on 'my-assets' folder returns below:
It is clear I see that for assets the 'properties' element has 'metadata' and dc:format' elements.
Whereas, for folders these elements don't exist.
Which makes sense, as dc:format and metadata nodes in CRX exists for assets and not folders.
So you can know whether it is a folder or an asset.
Thanks Nikhil for reply,
In my case metadata does not come, but i have done this using class field and it is working but to check this folders have sub-folders i am sending separate api calls for each folders and checking if it contains any folder or not which is time consuming, i need a way to send filter with request to check if it have folder or not
For file:
For folder :
I think for what you're after, you need query builder instead of Assets API.
You should get a JSON output with a list of all folders inside DAM:
Folder structure in DAM:
Views
Likes
Replies
Views
Likes
Replies