We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
benjaminkromer
4 years agoExplorer | Level 4
Try to Dowload files getting Error 400
I want to Download a file with a API Call. First I thought it would be a good idea to download it from the sharelink by changing the query parameter ?dl to 1 and then use axios to just get that and s...
Greg-DB
Dropbox Community Moderator
4 years agoIt looks like the different clients are producing different requests. For the requests that are failing with a 400 status code, print out the raw response body. The response body should contain a more useful error message indicating what the issue is.
For the call where you are getting that "%PDF-1.4..." data back, that indicates that the call succeeded, and Dropbox is returning the requested file data. The /2/files/download endpoint returns the exact bytes that are stored on the Dropbox server, which in this case is for a PDF file. From there, you can do whatever you need to with the data, such as passing it to some PDF viewer. I can't offer help with using the PDF data/format itself though as that's outside the scope of Dropbox API support. You may need to check the documentation for whatever PDF viewer you're using, or make sure the file originally uploaded to Dropbox is the version of the PDF you're looking for.
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!