cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Organizing your research is important to easily review and share it. Learn how Kim uses Dropbox to gather and organize her research right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Comments

Re: dropbox filesListFolder with limit args do not work well

dropbox filesListFolder with limit args do not work well

YuichiTateno
New member | Level 2

`dropbox.filesListFolder()` (js) with limit option does not work correctly. I think it was working until last week or so.

 

The correct behavior is that if you have a folder with dozens of data and you put `limit: 100`, you should be able to get all the data. However, it now only returns a maximum of 12 cases.

 

If I try to remove `limit: 100` and add `recursive: true`, I can get all dozens of data.

Since I have not changed anything in the implementation, I am assuming that the Dropbox API has changed its behavior.

1 Accepted Solution

Accepted Solutions

Re: dropbox filesListFolder with limit args do not work well

Greg-DB
Dropboxer

The 'limit' parameter does not guarantee how many results will be returned per page. It only puts an approximate limit on the maximum number of entries that may be returned. Per the documentation:

The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases.

You may get less than the 'limit' in any returned page of results.

 

Due to various factors, the exact number of entries you may get back per filesListFolder/filesListFolderContinue page can vary, and is not guaranteed to be consistent over time, or across accounts or different folders, etc. These methods aren't guaranteed to return all of the results in a single API call response, and there isn't a way to force it to do so, so you need to always check the returned FilesListFolderResult.has_more value. If the returned 'has_more' is true, you need to call back to filesListFolderContinue to get more results.

View solution in original post

2 Replies 2

Re: dropbox filesListFolder with limit args do not work well

Greg-DB
Dropboxer

The 'limit' parameter does not guarantee how many results will be returned per page. It only puts an approximate limit on the maximum number of entries that may be returned. Per the documentation:

The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases.

You may get less than the 'limit' in any returned page of results.

 

Due to various factors, the exact number of entries you may get back per filesListFolder/filesListFolderContinue page can vary, and is not guaranteed to be consistent over time, or across accounts or different folders, etc. These methods aren't guaranteed to return all of the results in a single API call response, and there isn't a way to force it to do so, so you need to always check the returned FilesListFolderResult.has_more value. If the returned 'has_more' is true, you need to call back to filesListFolderContinue to get more results.

Re: dropbox filesListFolder with limit args do not work well

YuichiTateno
New member | Level 2

Thanks for the reply.

I checked `has_more` and fixed it to work fine.

Need more support?