We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
anonymous
9 years agoBest way to get a file's URL
I am making an iOS app that displays all of the images from a selected folder. To make caching the images easier and more efficient I'm using the SDWebImage Library. SDWebImage requires a URL and I'm...
- 9 years agoThat is the right way to get a direct link to a file using the API.
I'll be happy to pass along as feedback or feature requests though. What specifically would be more useful? Thanks in advance!
Greg-DB
Dropbox Community Moderator
9 years agoThat is the right way to get a direct link to a file using the API.
I'll be happy to pass along as feedback or feature requests though. What specifically would be more useful? Thanks in advance!
I'll be happy to pass along as feedback or feature requests though. What specifically would be more useful? Thanks in advance!
mikemalter
9 years agoHelpful | Level 5
I may not be thinking about this correctly, so I'm open to alternatives. I need to generate a document that lists all of the files and folders off of a selected Dropbox folder. This I can do now with no issues. One additional requirement is that the list be hyperlinked so if someone clicks on a link, that document will open. I could have file hyperlinks for our desktop users, but what about mobile phone users? I'm thinking that I'll need URL's for that. So I need to know how to get URL's for selected files. However, one of the messages above talks about links expiring. Is there a way to get a permanant URL that can be stored in a document?
Thanks.
- Greg-DB9 years ago
Dropbox Community Moderator
mikemalter It sounds like Dropbox shared links might be a good solution for your use case. They don't expire (though they can be manually revoked). You can create them programmatically using the API via /2/sharing/create_shared_link_with_settings (or a corresponding method if you're using an official SDK).
- mikemalter9 years agoHelpful | Level 5
@Greg K., thanks for your answer. Of course I have a few more questions.
- If our group's content manager set up shared folders, is that the same thing as shared files? Do we have to create a shared link to every file?
- I looked at the Json code to create a shared link and I'm wondering can I do the same thing in C#? I have not coded anything in Json at this point.
- I noticed that there did not seem to be anyway to get a copy of the link for a file. Is there a way to query dropbox and get the shared links of all files that exist?
Thanks for your help. I am so new to this that my questions might not make sense, but hopefully you'll see what I'm up to and can answer accordingly.
- Greg-DB9 years ago
Dropbox Community Moderator
mikemalter No problem:
1. No, shared folders are not the same as shared links. There's a help center article that covers these two different kinds of sharing here:
https://help.dropbox.com/files-folders/share-file-or-folder
2. Yes, you can call the API from essentially any platform where you can make arbitrary HTTPS calls. If you're using C#, we recommend using the official Dropbox API v2 .NET SDK, if you can. The SDK will do most of the work for you. For example, it has a CreateSharedLinkWithSettingsAsync method for /2/sharing/create_shared_link_with_settings.
3. Yes, you can retrieve existing shared links using /2/sharing/list_shared_links (which is ListSharedLinksAsync in the .NET SDK).
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!