I tried getting the files in the selected folders using this code:
Quotefunction getAllFiles() {
IMWS.get('v1/files', {
idlist: IMatch.selectedFolders,
fields: 'id,filename,name,namene,ext'
}).then(function (response) {
allfiles = response.files;
console.log(JSON.stringify(response, null, 2))
.......
This returns all the files in the db. The selected folder has only 23 files. Am I doing something wrong?
idlist: IMatch.selectedFolders,
is wrong. This idlist does not exist. And as a fallback IMatch returns all files.
Look carefully at the name. and then check again in the documentation of the IMatch class.
I find in Imatchlib.js:
selectedFolders : '@imatch.selectedFolders',
I tried IMatch.idlist.focusedFiles, / and also '@imatch.selectedFolders',
It is always IMatch.idlist...
I will analyze this over the weekend. IMatch.idlist.selectedFolders should work for the folders/files endpoint, but not for /files.
/files expects a list of file ids, not folder ids.