Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
apullin
4 years agoExplorer | Level 4
Minimal client to "sync" files via API?
Hi all, I have a question about how to use the Dropbox API to accomplish something: sync a bunch of files into a Dropbox folder. Sounds easy, right? Well, this is going to be done from an embed...
Greg-DB
Dropbox Community Moderator
4 years agoThat's correct, the Dropbox API allows you to list, upload, and download files (among other operations), but we don't provide pre-built code for a full sync solution like that, so you'll need to write your algorithm to meet the needs of your use case. You can find everything for the API here, including the full terms here.
Note that as a matter of security, all Dropbox API calls do require TLS.
Also, unfortunately, the Dropbox API doesn't offer a way to retrieve the metadata for multiple specific items at once. I'll pass this along as a feature request, but I can't promise if or when that might be implemented. Depending on your use case though, e.g., if the items are under a common parent folder, one thing you can do is use /2/files/list_folder[/continue] to list everything under that parent path and then filter the returned entries for the desired items.
apullin
4 years agoExplorer | Level 4
OK, great. If the expectation is that I should be doing this level of operation manually, then I will forge ahead on implementing that way.
In my application, it is really only one-way push:
If the device has the file, and the DB app folder does not, or if it has an old version, then upload.
Although, my backend colleague is now insisting that we wrap this all in a lambda function, so we can just define our own interface & machinery (like batching) cloud-side, and we know for certain that Lambda can sustain a back-and-forth sequence of HTTP requests on a single held-open socket.
So ... the first prototype might just use that route.
But I will *eventually* try going direct from device -> dropbox API.
(maybe ... device OTA via DB? 🤔 )
Out of curiosity: How does the Dropbox desktop client handle a full bi-directional sync on startup ... surely it doesn't do a hash and an API call (or RPC or whatever internal tooling you have) for every file, each time it is started?
- Greg-DB4 years ago
Dropbox Community Moderator
I don't have specific information about how the official Dropbox desktop application works to share, but it does involve a significant amount of code to monitor the local filesystem as well as changes on the Dropbox servers and sync the two together.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!