You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
ivan006
5 years agoHelpful | Level 6
I need a php/js based webapp that syncs files between it's server and it's dropbox app folder
It only needs to be a one way sync (from dropbox to the server) Any recommended libraries/tutorials/endpoints to do this? [ same q dif platform https://stackoverflow.com/questions/61755432/dropbox-s...
Greg-DB
Dropbox Staff
Dropbox doesn't offer a pre-built library or tutorial for a sync client, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
The Dropbox API does offer the ability to list, upload, and download files programmatically though, among other operations, so you can implement whatever kind of syncing you need in your app's code.
For example, to list files and folders:
- https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
- https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue
To download files:
To upload files:
Those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints. Dropbox does offer an official JavaScript SDK, but not one for PHP. For PHP, you could use the endpoints as above, or a third party library, such as the ones listed here.
ivan006
5 years agoHelpful | Level 6
to further the quality of my question - I hope this helps:
Q: describe the problem and what has been done so far to solve it
A: the problem is im not sure what mechanism to use to determine changes to dropbox app folder, maybe webhooks?
- Greg-DB5 years agoDropbox Staff
Webhooks can tell you when something changed, but not what changed. To find out what changed, you would then use the list_folder endpoints. In addition to letting you list the contents, the list_folder endpoints also enable you to keep track of new changes over time:
- https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
- https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue
I also recommend reviewing the Content Access Guide for some more information.
- ivan0065 years agoHelpful | Level 6
Ok so how do i find out what changed? is it a file property?
please dont tell me ur refering to the date modified property? unless that could work as i could say "if it has changed in the last five minutes after the webhook fired then download it"...
Side note: Is there a statergy for this requirement or am i the only person in the world who has ever considered such things? lol- Greg-DB5 years agoDropbox Staff
You can store the last received cursor from /2/files/list_folder or /2/files/list_folder/continue and then call back later to /2/files/list_folder/continue with that cursor. The response will contain entries for the changes since you last called. Check out the /2/files/list_folder documentation for more information on how to process these entries.
Exactly how you write your code will depend on what exactly you need your app to do of course, but I imagine other people have implemented things like this. Perhaps others on the forum can offer some insight on their experience when doing so if they see this thread.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf 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!