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.

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: 

Re: [Q] Direct file links with APIv2

[Q] Direct file links with APIv2

Eugene G.4
New member | Level 1

Hi.

Can i get the direct links to files, stored on Dropbox, with APIv2 similarly to APIv1 (

https://content.dropboxapi.com/1/files/auto/

) so that i can reuse my code?

Thank you for your help.
Eugene

2 Replies 2

Greg-DB
Dropbox Staff

Hi Eugene, yes, you can still construct an API v2 call for a "content-download" endpoint like this using just a URL. You can find information on this in the formats section of the documentation. For example, for the /2/files/download endpoint, instead of the typical way as shown in the example:

curl -X POST https://content.dropboxapi.com/2/files/download \
--header "Authorization: Bearer <ACCESS_TOKEN>" \
--header "Dropbox-API-Arg: {\"path\": \"/test.mov\"}"

you can do this:

curl "https://content.dropboxapi.com/2/files/download?arg=%7B%22path%22%3A%20%22/test.mov%22%7D&authorization=Bearer%20<ACCESS_TOKEN>"

Alternatively, you can use /2/files/get_temporary_link to get a temporary direct link, like this:

curl -X POST https://api.dropboxapi.com/2/files/get_temporary_link \
--header "Authorization: Bearer <ACCESS_TOKEN>" \
--header "Content-Type: application/json" \
--data "{\"path\": \"/test.mov\"}"

Hope this helps!

 

Eugene G.4
New member | Level 1

Hello Gregory.

 

Thank you. It helped a lot.

Have a nice day!

Eugene

Need more support?