cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: list_folder API not starting from beginning of directory

list_folder API not starting from beginning of directory

dcooney
Explorer | Level 4

I'm building a mobile app for viewing the /Camera Uploads path and for whatever reason the initial query does not start from the beginning of the directory.

 

To explain more, my /Camera Uploads files go back as far as 2010, yet the list_folder starts returning entries from 2013 and skips the first 500 or so photos.

 

I even tried using the API explorer to the same results.

 

Would there be any reason for this? I can post the code if it would help.

 

Thank you!

6 Replies 6

Greg-DB
Dropbox Staff
The list_folder endpoints do not promise a certain order for the returned entries. I.e., the first returned entries may not be the oldest ones.

Your app should check the has_more value in the result, and if it's true, call back to /2/files/list_folder/continue to get the rest of the entries. Once you process the all of the entries, you can apply whatever ordering you want.

dcooney
Explorer | Level 4

Hi Greg,

Thanks for the reply.
That's fine, but it does start at a seeminly random date and it's always that same date (January 30, 2013). Also, It does continue in order by date after that initial request using the /list_folder/continue method.

Maybe i'm missing something, but just thought I'd ask why this is.

Greg-DB
Dropbox Staff
The exact order will depend on how things work on the Dropbox backend, so while it may be at least partially in chronological order, it's not guaranteed or externally predictable.

As long as you call back and retrieve all of the pages, based on has_more, you should receive all of the entries.

dcooney
Explorer | Level 4

Thanks Greg,

I can confirm I do not get all the entires from the camera uploads directory.


Is it possible there is a limit? I have over 20k items in this folder.

 

 

Greg-DB
Dropbox Staff
There isn't an overall limit. If you're calling /2/files/list_folder/continue repeatedly until has_more=false and you're still missing entries, please open an API ticket with the details so we can check on it for you:

https://www.dropbox.com/developers/contact

The following would be useful:
- the registered app name or key
- the user ID of the affected account
- the relevant code snippet(s)
- some sample missing file paths/names and a screenshot showing them on the web site for comparison

dcooney
Explorer | Level 4

This is exactly what i'm doing 🙂

I will open a ticket. thanks Greg!

Need more support?