cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

example of periodically migrating new files from shared folders?

example of periodically migrating new files from shared folders?

Erik B.20
New member | Level 1

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 1

Greg-DB
Dropbox Staff

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?