Learn how to make the most out of the Dropbox Community here 💙!
Forum Discussion
bneese
2 months agoNew member | Level 1
Save URL Endpoint for Public Folders via API
When I use the files/save_url API endpoint and enter the URL of a public folder, I get an invalid_url error. I am assuming this is because this endpoint only works on files, not folders, is that correct? Or is the issue with public links, since this folder wasn't shared with me via Dropbox and doesn't exist in my Dropbox account?
Is there an option to save a folder and its subfolders/files via the API? My intent is for this to have the same effect as a user clicking the "Copy to Dropbox" button that appears when viewing a public Dropbox folder.
Thanks in advance!
- DB-Des
Dropbox Engineer
Hi bneese,
Thank you for providing additional context. In the case of the /files/list_folder[continue] endpoint, the path parameter only accepts paths relative to the authorized user's Dropbox. It is not possible to pass a URL as the path for that endpoint either.
- DB-Des
Dropbox Engineer
My apologies, after reviewing the developer documentation, I realized there is actually a way to pass a share link URL to the /files/list_folder endpoint.
You can pass that link to the shared_link parameter. Note that in this case, the path will be relative to root of the shared link.
- DB-Des
Dropbox Engineer
Hi bneese,
You are correct, the endpoint /files/save_url is meant to save data from a specified URL into a file. That said, I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
While it is not possible to save/copy folders directly to Dropbox via the API, especially from a URL, there is the option of creating folders via /files/create_folder_v2 or /files/create_folder_batch.
An option to simulate the "Copy to Dropbox" action, could be to retrieve the folder names from one Dropbox account, by calling /files/list_folder/[continue], and then have your app/integration create folders with the same name and hierarchy via /files/create_folder_v2 or /files/create_folder_batch on another Dropbox account.
- bneeseNew member | Level 1
Hi DB-Des,
Thanks for the quick reply! That would be a great feature for me, thank you for passing it along as a request.
I have thought about simulating the "Copy to Dropbox" action similar to how you mentioned, but can I call the /files/list_folder action on a public URL? In my use case, the owner of the Dropbox folder is not willing to "share" the folder with anyone, they will only expose the contents via a public URL.
- DB-Des
Dropbox Engineer
Hi bneese,
To allow an API app to act on a user's behalf, the user would need to grant consent through the OAuth authorization flow. This ensures the app has the necessary permissions to perform actions on the user's behalf.
Regarding your question about calling the /files/list_folder from a public URL, could you provide more details on your specific use case? As previously mentioned, authorization would need to be granted by users in order to make requests to the Dropbox API.
About Discuss Dropbox Developer & API
Make connections with other developers810 PostsLatest Activity: 4 days ago
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!