Fetch DAM Assets grouped by Folder Structure | Community
Skip to main content
Ravi_S
Level 2
January 22, 2019
Solved

Fetch DAM Assets grouped by Folder Structure

  • January 22, 2019
  • 2 replies
  • 1382 views

Hi All,

I want to check and see if there is a way within either the Query Builder or any of the API's where we can get all the assets under a given path grouped by folder structure

Here is a sample query that just gets the assets based on type

http://localhost:6602/bin/querybuilder.json?p.guesstotal=true&p.hits=full&p.limit=-1&p.nodedepth=2&path=%2fcontent%2fdam…

I want to see if we can get the JSON including the folder name and all the assets under the folder name grouped via folders.

I can use the Query Builder API  to get the folders alone and then construct a custom JSON to get all child nodes under each folder of the Type Assets and their metadata but want to check and see if there is a better way to do this.

Any suggestions are helpful

Thanks,

Ravi

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 Gaurav-Behl

You could use any type of query in source code - QB, SQL2, xpath. Make sure to make it more specific and fetch relevant data to optimize it.

sample SQL2 query to just fetch asset/folder names with url1. Based on your requirements, you could add metadata or other nodes..

SELECT * FROM [dam:Asset] as s WHERE (NAME() LIKE '%.jp%' or NAME() LIKE '%.png') and ISDESCENDANTNODE(s,'/content/dam/we-retail')

2 replies

smacdonald2008
Level 10
January 22, 2019

Looks like your way of using QB API and then constructing JSON is the solution here.

Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
January 22, 2019

You could use any type of query in source code - QB, SQL2, xpath. Make sure to make it more specific and fetch relevant data to optimize it.

sample SQL2 query to just fetch asset/folder names with url1. Based on your requirements, you could add metadata or other nodes..

SELECT * FROM [dam:Asset] as s WHERE (NAME() LIKE '%.jp%' or NAME() LIKE '%.png') and ISDESCENDANTNODE(s,'/content/dam/we-retail')