cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you new to Dropbox? Our Newcomers group is the perfect place to learn the basics, find out more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

Direct link to image file

Direct link to image file

danc222
Explorer | Level 3
Go to solution

Hi, I'd like to know if there is a way to create a direct link to a file using the API. My app requires sending an image link to a 3rd party's API for image recognition. When I test the link created using "create_shared_link_with_settings", I get something like 

www.dropbox.com/s/8um0tttqgbjq5c7/my_image.jpg  

But it is not recognised as an image. Thanks

1 Accepted Solution

Accepted Solutions

TaylorKrusen
Dropbox Staff
Go to solution

Thanks for the link. Neat tool. I found a solution! 

The share/get_temporary_link is the one you want. You can test it out in the API explorer real quick to verify before you write the code. 

Cheers!

View solution in original post

6 Replies 6

TaylorKrusen
Dropbox Staff
Go to solution

Hi, 

Is the 3rd party API you're calling expecting a file or a URL to an image? 

I'd expect it to need the entire file, in which case you'll need to download (files/download) the file onto your server and upload the file to the other API for processing. 

danc222
Explorer | Level 3
Go to solution

Hi, thanks for the reply. The API is expecting a URL to the image. You can actually see for yourself here https://imagga.com/auto-tagging-demo

Links generated via the Dropbox API do not work as I assume the URL given is a 'container' with meta data, download links and comments etc. I am looking for a direct link to the media. Is this possible with Dropbox? Thanks

danc222
Explorer | Level 3
Go to solution

To add some more information:

I created a link of an image and got something that looked like:
www.dropbox.com/s/8um0tttqgbjq5c7/my_image.jpg  

But after downloading the image to my desktop, the actual link to the image file looked like:https://uc16303a726d517a4932231f53ee.dl.dropboxusercontent.com/cd/0/get/AjqdFl9BQdUPdRx5SUC83nDAmmbl...

This form of URL works with the API in question. So my question is...is there a way to generate this URL?

TaylorKrusen
Dropbox Staff
Go to solution

Thanks for the link. Neat tool. I found a solution! 

The share/get_temporary_link is the one you want. You can test it out in the API explorer real quick to verify before you write the code. 

Cheers!

danc222
Explorer | Level 3
Go to solution

Thanks Taylor, that seems to do the trick! I see temporary links expire after 4 hours but new ones can be generated on demand. Works fine for me.

Busy beaver
New member | Level 2
Go to solution

Idk is it legit, but I found a solution here - https://zapier.com/blog/generate-direct-dropbox-link/

It is just to replace "www.dropbox.com" in your url with "dl.dropboxusercontent.com". So in your case it would be dl.dropboxusercontent.com/s/8um0tttqgbjq5c7/my_image.jpg .

Whois tells that that domain belongs to the same company as dropbox.com so probably that's not a third-party website.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Busy beaver New member | Level 2
  • User avatar
    danc222 Explorer | Level 3
  • User avatar
    TaylorKrusen Dropbox Staff
What do Dropbox user levels mean?