We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

AlexBrajkovic's avatar
AlexBrajkovic
Explorer | Level 4
8 years ago

ListFolder limit?

What is the limit of retrieved items using listFolder? When using listFolderContinue, what will be response? All data, including files/folders from previous call to listfolder) or just additional ...
  • jwpegram's avatar
    8 years ago

    I don't see where there is an actual limit that you can set, it seems to be arbitrary. That said, basically when you make the initial post to list_folder that will return some number of entities along with a cursor value and a has_more value. Think of the cursor as a page value that already knows the user being queried and other information so all you have to post to list_folder/continue all you have to send it is the cursor value. That will return the next page of entities along with another cursor for the page after that, and so on until cursor is returned empty.  Not sure what language you are using but I'm doing it like this in PHP.

     

    $first_page = true;

    $api = $first_page ? 'https://api.dropboxapi.com/2/files/list_folder' : 'https://api.dropboxapi.com/2/files/list_folder/continue';

    do {

     

    if ($first_page) {

        $data = json_encode(array(
            "path" => "",
            "recursive" => true,
            "include_media_info" => false,
            "include_deleted" => true,
            "include_has_explicit_shared_members" => false,
        ));

        $first_page = false;

    } else {

         $data = json_encode(array(
            'cursor' => $cursor
        ));

    }

     

    ... Make the call out to the endpoint and get the response ($response);

     

    } while {$response->has_more);

     

    After the first call out $first_page is set to false so if $response->has_more returns 1 the cursor is sent page requesting the next page.  Once you hit the end $response->has_more will be empty.

     

    Hope that helps.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

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 or Facebook.

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!