Get folder contents with Rest API

Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
dah
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Tue Jun 06, 2017 6:53 pm

Get folder contents with Rest API

Post by dah » Tue Jun 06, 2017 7:01 pm

I am finding plenty of examples of getting child folders using the rest API with the following command -

Code: Select all

http://localhost:8080/OpenKM/services/rest/folder/getChildren?fldId=ea949a7f-79b4-410f-a2d3-48103cd46ff4
However I want to navigate down the tree but can't seem to find anything that will give me back the documents contained within a folder. In fact when a folder is returned by the above GET request it always indicates that the returned folders have no children even though there are a number of documents in each?

Code: Select all

{
  "folder": [
    {
      "author": "Joe",
      "created": "2017-06-06T16:47:02Z",
      "path": "/okm:root/Joes Folder",
      "permissions": 15,
      "subscribed": false,
      "uuid": "a84d147b-e9e4-4b5c-aa36-221461d1d5cd",
[color=#FF0000] [b]     "hasChildren": false[/b][/color]
    },
....
  ]
}
Any help would be much appreciated.

jllort
Moderator
Moderator
Posts: 10929
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Get folder contents with Rest API

Post by jllort » Thu Jun 08, 2017 6:11 am

You might go to document where exists a getChildren. The method will return the documents what are into some folder.

I suggest also take a look at OpenKM https://docs.openkm.com/kcenter/view/ok ... ption.html it's not exactly but very similar to OpenKM REST API and might help you finding the methods you need ( almost OpenKM API methods have it's own equivalent into REST API ). Meanwhile we do not have documented the REST API a good aproach is OpenKM API.

Post Reply