We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
MarshallDavis
2 years agoNew member | Level 2
Entries Count Differs from Requested Limit
I'm using the /list_folder endpoint using the Dropbox-API-Path-Root header to display content from a team with shared dropbox. When I use the limit parameter with a value of 20 this returns 16 entrie...
Greg-DB
Dropbox Community Moderator
2 years agoThe page size returned by /2/files/list_folder or /2/files/list_folder/continue is not guaranteed, and the 'limit' parameter is the "maximum number of results to return per request". As that is only intended as a maximum, the server will attempt to not return more than that per page, but it is not guaranteed to return exactly that amount per page. Additionally, as you noted, in some cases it may even return slightly more than that amount per page.
Regardless of the number of returned entries on any given page and also regardless of the specified 'limit' value, the app should always check the returned 'has_more' value to determine if it should call back to /2/files/list_folder/continue to get more results. Please refer to the documentation linked above for information on using that.
- MarshallDavis2 years agoNew member | Level 2
While factual, and as evidenced by my observations, this doesn't help me understand why I might expect 16. Are some removed from the results after the page is selected? Is there something I can do to help fit specific files into pages?
- Greg-DB2 years ago
Dropbox Community Moderator
The actual number of entries returned per page depends on a few implementation details of how Dropbox works, but I don't have more specific details to share on how that works.
Apps shouldn't rely on a specific number of entries being returned per page though; apps should process any/all entries returned on a given page, and then check 'has_more' to determine if it should call back to /2/files/list_folder/continue, processing all entries on all returned pages until 'has_more' is false.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!