Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello, I am new in here
I try to develop a script that can auto email a Dropbox link to someone
I am using .sharing_create_shared_link_with_settings to determine does the file had been shared or not
However, now I encounter a new python exception which is "not_found",
my situation is, now I have 2 python exceptions, "not_found" and "shared_link_already_exists"
my question is, how do I let python know that the exception is "not_found" or "shared_link_already_exists" , so I can code some actions depends on the different exception
Here's an example of how you can tell apart different errors:
import dropbox from dropbox.exceptions import ApiError dbx = dropbox.Dropbox("<ACCESS_TOKEN>") try: print(dbx.sharing_create_shared_link_with_settings("/test222.txt")) except ApiError as err: if err.error.is_shared_link_already_exists(): print("Link already exists.") if err.error.is_path() and err.error.get_path().is_not_found(): print("File not found.") elif err.error.is_settings_error(): print(err.error.get_settings_error()) else: print(err)
Oh~I see~!
Thank you for your help
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 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!