Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

dcooney's avatar
dcooney
Explorer | Level 4
7 years ago

list_folder API not starting from beginning of directory

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago
    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's avatar
    dcooney
    Explorer | Level 4
    7 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago
    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's avatar
    dcooney
    Explorer | Level 4
    7 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago
    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's avatar
    dcooney
    Explorer | Level 4
    7 years ago

    This is exactly what i'm doing :)

    I will open a ticket. thanks Greg!

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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

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!