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

Forum Discussion

Erik B.20's avatar
Erik B.20
New member | Level 1
9 years ago

example of periodically migrating new files from shared folders?

We are  looking for examples and pointers to help us with the creation of a  system using your python tools wherein:

Clients will share a folder with our business. What is the best practice for doing this?  Can we collect their credentials on our site (I am imagining something like openID wherein they authenticate their dropbox account.  Is there an example of this)?  Or should they share their folder with our business via their dropbox client application?  Or is there another way?

Once folders are shared with us, we want to check those folders every N minutes to look for new files.  What is the best practice for determining which files are new?  Checksums or time stamps that we do the book keeping on? Or do your tools let us track what we've downloaded already and help us filter for only new files?

If there are new files in one of the sahred folders, we want to copy them to aws s3. Are there examples of this migration?.  The files could be large video files.  Some preliminary research suggests this might be problematic when moving files from a shared folder -- is this the case (http://stackoverflow.com/a/20243081/62255)?

Thank you for any pointers and suggestions!

 

 

 

1 Reply

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

    Hi Erik, if you want to integrate with the Dropbox API using Python, I recommend using the official Dropbox Python SDK:

    https://www.dropbox.com/developers/documentation/python

    You can find a tutorial, examples, and documentation there to help you get started. 

    You can have your users authorize your app to connect to their accounts by using the OAuth flow. 

    Then, for example, to programmatically share a folder, you can use the sharing_share_folder method to share a folder, and then sharing_add_file_member to invite members.

    That may not actually be necessary though, depending on how you build it, as you can just monitor the users' own connected accounts directly. For example, if you're building a web app, you can use webhooks to be notified of file changes to the connected accounts. 

    You can use files_list_folder and files_list_folder_continue to list files and folders in an account, using the "rev" value to keep track of whether or not you downloaded a particular version of a file.

    We don't have samples for S3 in particular, but you can use files_download to do the actual download. (The StackOverflow post you linked to is about downloading from shared links, not via the API.)

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!