cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Permanent sharing links via python api OR expiring sharing links via js in wix api

Permanent sharing links via python api OR expiring sharing links via js in wix api

autozoom3125
Explorer | Level 4

I have a system by which I load audio files to dropbox via python, and all of these files need to be accessable to anyone with the shared link, thus allowing me to give my site's visitors access to the lectures in my dropbox folder. 

Ideally, I'd like to create a permanent link for each file that I add to a collection on my site via a post-request, and I can then just use this url whenever necessary as queried by the site visitor. Is this possible? A permanent link to be saved for future reference? 

I've search far and wide, and haven't found a way to do this. So - on to my second best option:

Assuming I save the necessary meta-data to my site's collection, maybe I can then use some backend javascript in order to create and use the shared link. How should I go about this?

Can I use the key and secret I'm allready using in my python script? 

Does one use a url-fetch such as https://api.dropbox.com/1/shares/<root>/<path> ?

Or does one need to call sharingCreateSharedLinkWithSettings?

The site is a Wix created site in case it matters...

Any pointers would be greatly appreciated! 

Thanks!

 

 

3 Replies 3

Greg-DB
Dropbox Staff

First, for reference, that /1/shares URL is part of API v1, which is retired.

 

If you're using the Python SDK and want non-expiring shared links, you should use sharing_create_shared_link_with_settings. That allows you to programmatically create shared links that don't expire by default (but can be revoked by the user/app) for any file or folder. You can store and re-use these links as desired. You can also modify them if needed, for different behaviors such as direct file content access or download, as documented here.

autozoom3125
Explorer | Level 4

Thanks for the reply! I was under the imression that creating links via sharing_create_shared_link_with_settings creates expiring links.

But if they're permanent then that solves so much trouble I can't even explain!

 

 

 

Greg-DB
Dropbox Staff

No problem, I'm happy to help. For reference, some account types have the option to set an expiration on shared links, via SharedLinkSettings.expires, but by default there's no expiration.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    autozoom3125 Explorer | Level 4
What do Dropbox user levels mean?