We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
s00s
2 years agoNew member | Level 2
API integration
I'm saving images into Dropbox using the API. What I'm looking for is a way to get the image preview URL, which is then used in HTML as the src value like:
html
<img src="{image url from dropbox}" />
The current URL that I have is always redirected to the Dropbox website and shows the image inside the Dropbox site. Are there any possible solutions?
1 Reply
- Greg-DB2 years ago
Dropbox Community Moderator
You can get Dropbox shared links using the API via /2/sharing/create_shared_link_with_settings and /2/sharing/list_shared_links (or corresponding native methods in the SDKs).
You can use the URL parameters documented in this help article to get different behaviors from Dropbox shared links, such as to return the file data instead of the web page.
In particular, in this case it sounds like you'd want to use raw=1 (instead of the default dl=0).
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!