You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Chakradhar's avatar
Chakradhar
Explorer | Level 4
6 years ago

Reg: Folders not listing from API

Hello Team,

We have integrated DropBox API in our application and showing the folders based on the user login. Using the URL: **https://api.dropboxapi.com/2/files/list_folder** to download the folders from our application and show.

When we see it from our application seeing only a few folders whereas if login from Browser we are able to see the many folders. Please review the below screens for reference.

The below screen shows only few folders in the application.

When we log in from browser it shows many folders.

Please review and let us know what might be the issue?

 

Regards,

Chakradhar

  • Might be more easy to review raw JSON result. There always is field 'has_more', with value either true or false. 😉

    PS: There isn't guaranteed way receive everything at once. Could be received 'has_more' on the beginning, for short list, but no guarantee! Convenient way to pass the result is using codeblock (</>).

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Is the has_more value in the response from /2/files/list_folder set to true? If so, if you don't already have it implemented, you need to call back to /2/files/list_folder/continue to retrieve more results. Please refer to the /2/files/list_folder documentation for more information on doing so.

    The /2/files/list_folder[/continue] interface is paginated, in order to support folders of any size, and you're not guaranteed to receive all results on a single page, so you should make sure your app always checks the response to see if there are more results to return. 

    If that doesn't seem to be the problem though, please let me know and we'll be happy to look into it further for you

    • Chakradhar's avatar
      Chakradhar
      Explorer | Level 4

      Please review the new comment.

      Thank you

      Chakradhar

      • Здравко's avatar
        Здравко
        Legendary | Level 20

        Might be more easy to review raw JSON result. There always is field 'has_more', with value either true or false. 😉

        PS: There isn't guaranteed way receive everything at once. Could be received 'has_more' on the beginning, for short list, but no guarantee! Convenient way to pass the result is using codeblock (</>).

    • Chakradhar's avatar
      Chakradhar
      Explorer | Level 4

      Hi Greg-DB 

      Thank you for the response, we have reviewed the response received from the Dropbox. We are able to receive the Has_more value as true for one of our user accounts. Please check the attached file named "has_more_true.txt".

      And we connected to the other account which is showing all the folders where we received Has_more value as false. Please check the attached file named "has_more_false.txt".

      As per your comments if we receive has_more as true, we need to send the request again to continue to see the other folders. 

      Do we have an option to see all folders at a time even though the user has many folders/files? And we want to know why one account is showing all folders and another account is showing only limited folders.

      https://drive.google.com/file/d/1NGkx1ZMttdtR4yVUENP6kidmii2ePsA9/view?usp=sharing

      Thanks& Regards,

      Chakradhar

       

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Chakradhar Thanks for following up with this additional information. Since the API is replying with has_more:true in that case, you will need to call back to get the rest of the entries.

        There isn't a way to control this and make the API always return all of the entries in one page. There are a number of different variables in the implementation on the backend that can affect whether or not multiple pages are needed, so you should make sure to always check the has_more value.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 11 days ago
334 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!