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!
I'm getting this error:
dropbox.exceptions.ApiError: ('b5fdf345d4f997fe803468c16f5ceba0', CreateSharedLinkWithSettingsError('settings_error', SharedLinkSettingsError('invalid_settings', None)))
Code:
import datetimeimport dropboxdbx = 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