Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Eugene G.4's avatar
Eugene G.4
New member | Level 1
10 years ago

[Q] Direct file links with APIv2

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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's avatar
    Eugene G.4
    New member | Level 1
    10 years ago

    Hello Gregory.

     

    Thank you. It helped a lot.

    Have a nice day!

    Eugene

About Dropbox API Support & Feedback

Node avatar for 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!