Get a list of favorites files

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

Get a list of favorites files

Hello,

i would like to know, how can i get a list of favorites files from specific folder, for example i have folder in Sites/Home/documentLibrary/Documents and i need to get only favorites files via API aka

/alfresco/api/-default-/public/alfresco/versions/1/node/{nodeId}/children

Can i specify where query or use different API? Thanks

4 Replies
Highlighted
Alfresco Employee

Re: Get a list of favorites files

This is working for me:

curl --location --request GET \
'http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?skipCount=0&maxItems=100&include=isFavorite' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic YWRtaW46YWRtaW4='

What Alfresco version are you using?

Software Engineer in Alfresco Search Team.
Highlighted
Member II

Re: Get a list of favorites files

Ok sorry, i thought ONLY favorite files. I'm using ACS 6.2

Highlighted
Alfresco Employee

Re: Get a list of favorites files

Add "&where=(isFile%3Dtrue)" the the URL I gave you before and it will return files with the "isFavorite" property.

Software Engineer in Alfresco Search Team.
Highlighted
Member II

Re: Get a list of favorites files

Sorry, my english is maybe not good, but my goal is not to get property, but to get ONLY favorite files. For example, i need to show last 25 favorite files sorted by createdAt in folder sites/Test/documentLibrary/Documents and that what you are describing will get all files but with property isFavorite and what i need to do if i need to show last 25 favorite files? I have to paging and count isFavorite. And if the user would like see next page, next 25 favorite files, what i need to do? The same process.

Therefore i'm looking for possibility how to get ONLY favorite files via API children or Search API.

Thanks