cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Reg: Folders not listing from API

Reg: Folders not listing from API

Chakradhar
Explorer | Level 4
Go to solution

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

Здравко
Legendary | Level 20
Go to solution

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

8 Replies 8

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 4
Go to solution

Please review the new comment.

Thank you

Chakradhar

Здравко
Legendary | Level 20
Go to solution

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
Explorer | Level 4
Go to solution

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
Dropbox Staff
Go to solution

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

Sparsh C.
New member | Level 2
Go to solution

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. 

Здравко
Legendary | Level 20
Go to solution

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.

Greg-DB
Dropbox Staff
Go to solution

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

Need more support?