Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox API doesn't currently offer a way to set a custom expiration on shared links, but I'll be sure to pass this along as a feature request.
what about setting the password on shared links ?
That's also not currently available, but I'll pass that along as a request as well.
Is there any expected/known timeline for this?
Thanks!
This is now possible using the /sharing/create_shared_link_with_settings endpoint on API v2:
In the latest version of the Python SDK, that's the sharing_create_shared_link_with_settings method:
Oh! great, I was looking at v1 docs. Thank you very much!
sorry to revive this, but can someone show an example of how to pass settings here? Like:
dbx = dropbox.Dropbox("KEY")
dbx.users_get_current_account()
print dbx.sharing_create_shared_link_with_settings('link/to/share', ????)
I'm not sure how to pass the settings, like requested_visibility or link_password.
Sure, this creates a shared link for a file and also supplies a requested visibility and expiration in the settings:
import datetime
import dropbox
dbx = dropbox.Dropbox("<ACCESS_TOKEN>")
expires = datetime.datetime.now() + datetime.timedelta(days=30)
requested_visibility = dropbox.sharing.RequestedVisibility.team_only
desired_shared_link_settings = dropbox.sharing.SharedLinkSettings(requested_visibility=requested_visibility, expires=expires)
shared_link_metadata = dbx.sharing_create_shared_link_with_settings("/test.txt", settings=desired_shared_link_settings)
print(shared_link_metadata)
<ACCESS_TOKEN> should be replaced with the access token.
The dropbox.sharing.SharedLinkSettings constructor also takes a link_password parameter.
okay that's great. thank you so much. that really put that in perspective!
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!