Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello,
I've been tasked with creating shared folders for our team. Each team member will get their own folder that will contain files specific to them. I need a way to collect or create the shared links by automation rather than by copying and pasting as there are currently over 100 team members but this is likely to grow. Doing it by hand has proven to be time consuming and error prone.
Is it possible to do this automatically? I have some basic python knowledge but the API documentation is a little difficult.
In the end I would like a csv file listing the folder name and the shared link. Could someone point me in the right direction on this?
With thanks in advance,
James
Yes, you can use the Dropbox API to automate the creation of shared links. For Python, we recommend using the official Dropbox API v2 Python SDK:
https://github.com/dropbox/dropbox-sdk-python
With that, you can use the sharing_create_shared_link_with_settings method to create a shared link for any file or folder:
Sorry I'm obviously not understanding the documentation because I keep getting an error.
The folder i want the link for is called test it's in the same directory as the python code.
the_link = dbx.sharing_create_shared_link_with_settings('/test', settings=None)
print(the_link)
Traceback (most recent call last):
File "D:\james\Dropbox\Project KMG Instructors\dropbox test.py", line 13, in <module>
the_link = dbx.sharing_create_shared_link_with_settings('/test', settings=None)
File "C:\Users\james\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\base.py", line 4060, in sharing_create_shared_link_with_settings
r = self.request(
File "C:\Users\james\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\dropbox_client.py", line 346, in request
raise ApiError(res.request_id,
dropbox.exceptions.ApiError: ApiError('21aabc3f746b4a0ca5f079118eb3a353', CreateSharedLinkWithSettingsError('path', LookupError('not_found', None)))
Sorry I'm new to all this.
The path, "/test" in your code here, should be referring to the path of the file or folder in the Dropbox account, not related to the location of the code you're running.
I recommend reading the File Access Guide for reference.
The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.
Sound good? Let's get started.Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on Twitter or Facebook.
For more info on available support options, see this article.
If you found the answer to your question, please 'like' the post to say thanks to the user!