v1/folders always returns empty array

Started by baardman, December 31, 2017, 01:20:02 PM

Previous topic - Next topic

baardman

I want to check if a folder has any subfolders. If I use Get('v1/folders' ) an empty array folder returns. I tried it hardcoded as shown below with the same result.
When I try the examples with only a path as parameter in the IMatch webservices documentation I have the same result (for that I made a C:\images\beach).

IMatch.get('v1/folders',{
    path: 'C:\\',
    fields:'childrencount'
}).then(function(response) {
    console.log(JSON.stringify(response,null,2));
});

What am I doing wrong?

Mario

#1
Is the root folder c:\ indexed by your database? This would be rather unusual. You don't add entire hard disks to IMatch normally.
This endpoint can only return information about folders actually indexed by your database.

That "C:\images\beach" does not work is to be expected, except you really have c:\images\beach in your database.

I've tried your code fragment and it works - provided that the folder specified by path exists in the database.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

baardman

OK. Thanks. C:\\ was just an example.

I understand I can only use this for folders which are indexed. The folder I wanted to check is not indexed. I hoped this would work, because there is no other function I can use (as far as I can see).

Mario

If you want to process arbitrary file system folders, look at the filesystem/folder endpoint. Or one of the other filesystem endpoints.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook