cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn more about Dropbox Replay? We’ve just launched a brand new group, find out how to join 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: 

dropbox filesListFolder with limit args do not work well

dropbox filesListFolder with limit args do not work well

YuichiTateno
New member | Level 2
Go to solution

`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

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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.

YuichiTateno
New member | Level 2
Go to solution

Thanks for the reply.

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    YuichiTateno New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?