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: 

How to get file download url using api in php

How to get file download url using api in php

sunshine_sai
Helpful | Level 5

Hi, 

I want to get a dropbox storage file download link. I want a downloadable file URL programmatically or using PHP function that I can use when I need to download a file.

 

I want any code, function to get the URL of the file download  

I want a link to download the file, later. using PHP get download file URL with API

3 Replies 3

Greg-DB
Dropbox Staff

The standard way to download a file via the Dropbox API is the /2/files/download endpoint. That returns the file data directly in the response body.

 

If you do need a URL that you can use to download the file, you can call /2/files/get_temporary_link. That will return a link that you can use to access the file data later via a GET request. Note that these links are only valid for four hours though.

sunshine_sai
Helpful | Level 5

Thanks for your reply

but I want file download link which any time any one can download file directly from my dropbox storage from my site using this URL.

 

How to get that link using API or PHP 

Greg-DB
Dropbox Staff

If you need a non-temporary link, you can instead use /2/sharing/create_shared_link_with_settings to get a shared link.

 

You can also modify those shared links for different behaviors as documented here.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    sunshine_sai Helpful | Level 5
What do Dropbox user levels mean?