Topic: Files and Folder List API Result Count limitations

Hi,

I am using files and folder apis but facing the following issues -

1. Folder and File list Api do not return more than 10 items. Is there any concept of pagination or to increase the result set size.
2. Search a file within a folder does not work if file has space(s). It returns the non-unique result and based on some pattern match. I have a filename and i just want to call the getFile api to get the CloudmeFile object.

Can anyone please help me on this. Thanks in Advance!

Thanks,
Vikas

Re: Files and Folder List API Result Count limitations

Hello vikasgirnar,

1 - have you used the 'count' parameter ?

2 - I have the same problem regarding getting some informations about a file : the queryFolder API service accepts a search pattern in its 'query' parameter, but this presents limitations.
Imagine you have a folder with 3 files 'foo', 'foo1', foo10'.
Querying folder with query='foo' returns 3 files.
Querying folder with query='foo1' returns 2 files (foo1, foo10).
So if you have a folder containing many fooXXXX files, how do you retrieve 'foo' ?

I have encountered other limitations as well, if filename contains unusual characters : queryFolder may return several results, or no result at all (ie if filename contains a '*')...

Last edited by testxcst (2015-08-12 10:55:45)

Re: Files and Folder List API Result Count limitations

> testxcst wrote:

> Hello vikasgirnar,

1 - have you used the 'count' parameter ?

2 - I have the same problem regarding getting some informations about a file : the queryFolder API service accepts a search pattern in its 'query' parameter, but this presents limitations.
Imagine you have a folder with 3 files 'foo', 'foo1', foo10'.
Querying folder with query='foo' returns 3 files.
Querying folder with query='foo1' returns 2 files (foo1, foo10).
So if you have a folder containing many fooXXXX files, how do you retrieve 'foo' ?

I have encountered other limitations as well, if filename contains unusual characters : queryFolder may return several results, or no result at all (ie if filename contains a '*')...



Hi testxcst,

#1 About the count parameter

The count parameter is useful together with the offset parameter if you want to paginate your query.
For example, page 1:
      <offset>0</offset>
      <count>100</count>
Page 2:
      <offset>100</offset>
      <count>100</count>
Page 3:
      <offset>200</offset>
      <count>100</count>


#2 About searching for files by name

The query parameter is looking for exact matches you do not use the *, ie:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <queryFolder>
      <folder id="000000"/>
      <query>title:foo</query>
    </queryFolder>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Returns only the file 'foo'.

If you instead set it to 'title:foo*' it will return all files starting with 'foo'.

Edit: Using the quotes <query>"foo"</query> instead of <query>title:foo</query> also works.


#3 About the * in filenames
If you have files containing the star character, there may be some issues. I would strongly suggest you to avoid * in the filename, eventhough it's allowed.

If you name a file 'foo*' and search for it, you will indeed get all files starting with exactly that (see answer for #2). There is no escape for it.