Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi
How to expire a shared link in 1 minutes? I'm trying but doesn't work, when i try with days works properly.
Sorry for my english
Thanks
Setting the expiration to 1 minute in the future is working fine for me. Can you share your code and the error you're getting? Thanks in advance!
Hi
I'm getting this error:
dropbox.exceptions.ApiError: ('b5fdf345d4f997fe803468c16f5ceba0', CreateSharedLinkWithSettingsError('settings_error', SharedLinkSettingsError('invalid_settings', None)))
Code:
import datetime
import dropbox
dbx = dropbox.Dropbox(APP_TOKKEN)
expires = datetime.datetime.now() + datetime.timedelta(minutes=1)
shared_link_settings = dropbox.sharing.SharedLinkSettings(expires=expires)
shared_link_metadata = dbx.sharing_create_shared_link_with_settings("/test.txt", settings=shared_link_settings)
print(shared_link_metadata)
Thanks for helping me
Thanks Joel, that's helpful. The API expects UTC, so you should instead do:
expires = datetime.datetime.utcnow() + datetime.timedelta(minutes=1)
Its works!
Thank you so much
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!