cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco API to list All Files (in a Site/Node/Folder etc)

fawadali123
Champ on-the-rise
Champ on-the-rise

I am Alfresco Community Edition user. Exploring REST API but i cannot find APIs to list all files ,List Files in a Site, List All Files in a NODE, List All files for a specific Users etc. Someone answered on stackoverflow that its not not available out of the box.

http://localhost:8080/api-explorer/#!/sites/getSiteContainer

Can anyone help or provide some links for Alfresco REST API with comprehensive details/examples?

1 ACCEPTED ANSWER

I can get list of all files as below;

http://localhost:8080/alfresco/service/slingshot/doclib/doclist/node/site/{siteId}/documentlibrary/ 

May not be the best approach but looks like a work around for me at the moment. 

View answer in original post

4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator

The children operation on nodes should be ideal to get all files under a specific node. For sites there is no such operation to get all files in one go, except by going through queries. This is due to the fact that there can be any number of hierarchies that cannot be covered by a single navigation operation. The same goes for all files of a user, using either the cm:creator or cmSmiley Surprisedwner properties to determine "belonging to user" (cmSmiley Surprisedwner takes preference, i.e. if cmSmiley Surprisedwner is set, cm:creator is to be ignored).

Thank for a quick reply.  I will go through it. 

I can get list of all files as below;

http://localhost:8080/alfresco/service/slingshot/doclib/doclist/node/site/{siteId}/documentlibrary/ 

May not be the best approach but looks like a work around for me at the moment. 

gtarafder
Champ on-the-rise
Champ on-the-rise

I have achieved this using search API and PrefixPath.

Can be helpful for someone else

{
"query": {
"query": "PATH:\"/app:company_home/st:sites/cm:product-information/cm:documentLibrary//*\" AND (TYPE:\"cm:content\" OR TYPE:\"cm:folder\")",
"language": "lucene"
},
"include": ["properties"]
}