We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Andj
6 years agoExplorer | Level 3
Android: How can I download file with my custom Download manager using bearer access token?
I'm creating an app that help user download their from from their cloud drives (Dropbox, Google Drive). I create an download manager to let user download, pause, resume, eta, speed... So, how can I ...
- 6 years ago
To download a file directly from a connected account using the Dropbox API, you can use the /2/files/download endpoint. In the official Dropbox Java SDK, that's available the download methods.
Or, to get a temporary direct link to a file, you can use /2/files/get_temporary_link, which is getTemporaryLink in the Java SDK.
Either way, you authorize the call by setting the user's access token in the "Authorization" header like you described. If you're using the Java SDK, it will build the header for you.
The difference is that the /2/files/download endpoint will return the file data directly in the response, whereas the /2/files/get_temporary_link endpoint will return a temporary link to the data in the response. You can then use that link to download the data however desired, without using the access token.
Greg-DB
Dropbox Community Moderator
6 years agoTo download a file directly from a connected account using the Dropbox API, you can use the /2/files/download endpoint. In the official Dropbox Java SDK, that's available the download methods.
Or, to get a temporary direct link to a file, you can use /2/files/get_temporary_link, which is getTemporaryLink in the Java SDK.
Either way, you authorize the call by setting the user's access token in the "Authorization" header like you described. If you're using the Java SDK, it will build the header for you.
The difference is that the /2/files/download endpoint will return the file data directly in the response, whereas the /2/files/get_temporary_link endpoint will return a temporary link to the data in the response. You can then use that link to download the data however desired, without using the access token.
- Andj6 years agoExplorer | Level 3
Thank you, Greg! I have tried your suggestion using /files/download endpoint and it work perfectly.
About 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!