cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

[Q] Direct file links with APIv2

New member | Level 1
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
Highlighted

Re: [Q] Direct file links with APIv2

Dropboxer
Dropboxer

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!

 

Highlighted

Re: [Q] Direct file links with APIv2

New member | Level 1
New member | Level 1

Hello Gregory.

 

Thank you. It helped a lot.

Have a nice day!

Eugene

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?