Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.

Forum Discussion

itsmethedev's avatar
itsmethedev
New member | Level 2
2 years ago

Sorting Dropbox Folders by Most Recently Added or Updated Files Using the Dropbox API

Hello, Dropbox API community!

 

I'm interested in a method to organize my Dropbox folders based on the most recently updated or added folders. Is there an API available that can assist me with this?

 

Here's what I aim to accomplish:

  1. Access a specific Dropbox folder.
  2. List the folders within that directory.
  3. Sort the folders by their most recent modification date or addition date.
  4. Retrieve the sorted list of folders.

I've successfully integrated the Dropbox API into my project, and I'm proficient in listing the folders. However, my focus is on effectively arranging these folders based on their modification or addition date.

If you could provide any code examples or API endpoints that would aid me in achieving this goal, your assistance would be highly appreciated. Thank you for your valuable support!

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    You can use /2/files/list_folder[/continue] to list the files and folders under any particular path, but unfortunately the Dropbox API does not return the modification or creation date for folders in particular. I'll pass this along as a feature request, but I can't promise if or when that might be implemented.

     

    It does return the modification date for files though, so you could iterate through the files in a folder and take the most recent file modification date and use that as the effective modification date for the parent folder, if that works for your use case.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers815 PostsLatest Activity: 4 years ago
280 Following

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 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!