Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Babaraba Abdabi
3 years agoExplorer | Level 4
I want to obtain the URL of a file on Dropbox via an API.
I want to get the URL of the file for users with the appropriate access permissions to the file. This is not about the shared link URL. Is there an API to get the URL of a file on Dropbox? Or is the...
Babaraba Abdabi
3 years agoExplorer | Level 4
Thank you for your reply.
I understand that there is no API to obtain the URL for direct access (not sharing url).
In that case, I am considering a way to construct a link URL from the file path. Can I assume that all can be accessed from under `/home/` ?
example)
```
lower_path = "/foo/bar/baz/something.pdf"
dirname = File.dirname(lowerpath) # /foo/bar/baz
basename = File.basename(lowerpath) # something.pdf
"https://www.dropbox.com/home#{dirname}?preview=#{basename}"
```
Greg-DB
Dropbox Community Moderator
3 years agoBabaraba Abdabi As Здравко mentioned, you shouldn't assume that a link constructed like that will be necessarily correct always. We don't officially support building links like that; I recommend trying out the 'no_one' shared link option that I mentioned and that Здравко reiterated, as it sounds like it would be useful for your scenario.
- Babaraba Abdabi3 years agoExplorer | Level 4
Thank you for your replies.
I see, I understand that the case where constructing a URL is effective is extremely limited, and it is generally better to use the no_one sharing link.
My question has been resolved.
Thank you for your answers. These were really helpful.
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!