cancel
Showing results for 
Search instead for 
Did you mean: 

REST API to fetch all the documents in a workspace

Pranav_Pal
Champ in-the-making
Champ in-the-making

I need to fetch all folders/documents inside a workspace. I was going through the REST APIs mentioned here and tried the following REST call:

http://localhost:8080/nuxeo/site/api/v1/path/default-domain/workspaces/templatesamples

But this returns only the workspace document and not its children.

Is there any REST API to get all folders/contents in a workspace or in a folder?

1 ACCEPTED ANSWER

Florent_Guillau
World-Class Innovator
World-Class Innovator

Just do a query with /api/v1/query (see the Nuxeo API Playground) and pass a query like SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/workspaces/templatesamples'

View answer in original post

2 REPLIES 2

Florent_Guillau
World-Class Innovator
World-Class Innovator

Just do a query with /api/v1/query (see the Nuxeo API Playground) and pass a query like SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/workspaces/templatesamples'

Anurag_Kumar
Confirmed Champ
Confirmed Champ

Use this: http://localhost:8080/nuxeo/site/api/v1/path/@children

This will return you the json of all documents under root "/". hope this will solve your problem.