Forum Discussion

minamiSasaki's avatar
minamiSasaki
Explorer | Level 3
7 years ago

"has_more = true" was returned even though "files / list_folder" was less than "limit".

I tried to get information about all files and folders in my account.
I restricted the number of acquisitions by "limit".So I tried to get the rest by " / list_folder / continue", when I cannot get all.
However, "has_more=true" was returned returned, despite being less than the "limit".
Is this a bug in Dropbox?


Response example (42 items in total)
{
"entries": [
{
".tag": "folder",
"name": "test",
"path_lower": "/test",
"path_display": "/test",
"id": "id:dummy_id_aaaaa"
},
{
".tag": "folder",
"name": "test_folder",
"path_lower": "/test_folder",
"path_display": "test_folder",
"id": "id:dummy_id_bbbbb"
}
],
"cursor": "dummy_cursol_ccccc",
"has_more": true
}

4 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    Thanks for the report. This sort of thing can happen when using /2/files/list_folder[/continue], and while it's not a bug, we do understand it's not ideal.

    The limit the client supplies is only a guideline, and the API may not always be able to actually follow it. Because of how the Dropbox filesystem works on the backend, sometimes the API may return less than the limit, and sometimes it may actually return a little more.

    There's some information about this in the docs for the param:

    limit UInt32(min=1, max=2000)? 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.

    That's to point out that the value is only meant as a maximum, so the API can still return less than the specified value (but also sometimes more).

    So, all of that being the case, the client always needs to check the has_more value and call back to /2/files/list_folder/continue if it's true.

  • minamiSasaki's avatar
    minamiSasaki
    Explorer | Level 3
    7 years ago

    thank you for your answer.
    I understanded that it may return less than "limit".
    Even if / 2 / files / list_folder is used at the first acquisition, the same phenomenon occurs. Is this the same reason?

  • minamiSasaki's avatar
    minamiSasaki
    Explorer | Level 3
    7 years ago

    Thank you very much.
    Implement to get all items using / 2 / files / list_folder / continue.

About Dropbox API Support & Feedback

Node avatar for 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!