Announcements
Do you have an idea for Dropbox Paper? Share it with us here!

Reg: Folders not listing from API

Explorer | Level 4

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.

FoldersShowingInApplication.jpg

When we log in from browser it shows many folders.

FoldersShowingFrom_Browser.jpg

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

 

Regards,

Chakradhar

1 Accepted solution

Accepted Solutions

Re: Reg: Folders not listing from API

Star Collaborator | Level 19

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 (</>).

View solution in original post

Reply
Loading...
8 Replies

Re: Reg: Folders not listing from API

Dropboxer

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

Reply
Loading...

Re: Reg: Folders not listing from API

Explorer | Level 4

Please review the new comment.

Thank you

Chakradhar

Reply
Loading...

Re: Reg: Folders not listing from API

Star Collaborator | Level 19

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 (</>).

View solution in original post

Reply
Loading...

Re: Reg: Folders not listing from API

Explorer | Level 4

Hi @Greg K. 

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

 

Reply
Loading...

Re: Reg: Folders not listing from API

Dropboxer

@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.

Reply
Loading...

Re: Reg: Folders not listing from API

New member | Level 2

Hi Greg,

Thanks for the information. We are still not clear on the information. @Chakradhar has shared two files. One file is having very less records and having has_more : true. But another file is having very huge records and having has_more : false.

May we know why there is a difference in having has_more value differently in each response? 

Anyway, we will implement to load further data if we have has _more: true. But we need to know what's the difference we have in both responses.

We look forward to your reply. 

Reply
Loading...

Re: Reg: Folders not listing from API

Star Collaborator | Level 19

Hi @Sparsh C.,

I'm not so sure what is still not clear on the information. For every one big, heavy loaded network system, (like Dropbox, but not restricted to) it's always matter of load balancing. There are different ways achieve such balance. The Dropbox chosen one is described in the API documentation (as much as need for an API user). In accordance to available resource/load for every one API call, particular part of directory is processed (or entire). You can't predict what will happens during upcomming call, so you have to check discussed flag after every one step/call. That's it.

Hope this adds some extra clarity.

Reply
Loading...

Re: Reg: Folders not listing from API

Dropboxer

@Sparsh C. Здравко is correct. There are a number of different variables behind the scenes that can affect this behavior, and it's not possible to predict if/when multiple pages will be used. 

Reply
Loading...
API Support

Have a question? Our Dropbox Community is here to help you find an answer!
You won’t have to wait too long for a reply, but why not learn more about the Community while you’re here.

Not the right discussion for you? Find out what else our Community has to say about API Support.

Or, search our Help Center for even more.

Who's talking
Top contributors to this post