cancel
Showing results for 
Search instead for 
Did you mean: 

How to find folder nodeId using the REST API

patrykj
Champ in-the-making
Champ in-the-making
Hi,
sorry for the newbie question, but I'm new to Alfresco and I would appreciate any help.
I would like to use the REST API in order to lookup a folder. What I know is: the name of the folder I'm looking for and his parent folder. What I need to get is his nodeId (if exists) or information that it doesn't exists (so I can create one).
I can't find a good example on the internet.
The client that I'm using currently has a wrapper for `/search/folder/{store_type}/{store_id}/{id}?query={query}` but it doesn't work with my (local) Alfresco - it returns 404. I also tried a wrapper for `search/advanced`. With no luck. (The requests were authorized properly.)
My Alfresco version is Alfresco One 5.1

I would appreciate any help or hints
Thank you
4 REPLIES 4

gawadesk
Star Contributor
Star Contributor
Hi,

Do you have Node reference of parent folder ? If yes then you can get children of that parent folder using this <a href="http://docs.alfresco.com/5.0/pra/1/concepts/cmis-get-node-children.html" > CMIS API</a>

If not then you can find node using node path by using <a =href="http://docs.alfresco.com/5.1/references/API-JS-findNode.html">scripting API.</a>

Let me know if this help you..

Thanks,
Krishna

patrykj
Champ in-the-making
Champ in-the-making
CMIS works like a charm. Thank you

How to do it with CMIS like       select * from cmis:folder???please~~~

andy1
Star Collaborator
Star Collaborator

Hi

I assume you want something like

SELECT * from cmis:folder where IN_FOLDER('some_id') and cmis:name = 'some_name'

You should take a look at the public API.

Andy