cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out 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: /files/download API fails

/files/download API fails

simotin13
Helpful | Level 5

Hi,
I'm using Dropbox API and found /files/download API fails since few days before.

The API return following response body,


<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Dropbox - 400</title>
<link href="https://cfl.dropboxstatic.com/static/metaserver/static/css/error.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="https://cfl.dropboxstatic.com/static/images/favicon.ico"/>
</head>
<body>
<div class="figure">
<img src="https://assets.dropbox.com/www/en-us/illustrations/spot/target-miss.svg" alt="Error: 400"/>
</div>
<div id="errorbox">
<h1>Error (400)</h1>Something went wrong. Don't worry, your files are still safe and the Dropbox team has been notified. Check out our <a href="https://status.dropbox.com">Status Page</a> to see if there is a known incident, our <a href="https://www.dropbox.com/help">Help Center</a> and <a href="https://forums.dropbox.com">forums</a> for help, or head back to <a href="https://www.dropbox.com/home">home</a>.
</div>

 

some APIs are still works successfully ex.(/get_metadata, /list_folder, /get_thumbnail), but '/files/download' fail.

Is there any information about this issue?

Thanks in advance simotin13

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff

As Здравко mentioned, please make sure you're encoding header values as documented here: https://www.dropbox.com/developers/reference/json-encoding

View solution in original post

13 Replies 13

Nico-Uretek
Helpful | Level 5

Hi ! Same error since yesterday but on insert file....

Some news from DB ? An issue ? 

Thanks !

simotin13
Helpful | Level 5

I'm still checking this issue and found that /files/download fails when path include multibyte string, but only ASCII it works.So it's a kind of character encoding problem I think.

 

curl -X POST https://content.dropboxapi.com/2/files/download --header "Authorization: Bearer access_token " --header "Dropbox-API-Arg: {\"path\":\"/aaa/bbb/sample.jpg\"}"

→ This request works

 

curl -X POST https://content.dropboxapi.com/2/files/download --header "Authorization: Bearer access_token " --header "Dropbox-API-Arg: {\"path\":\"/aaa/あいうえお/sample.jpg\"}"

→ This request doesn't work.  I'm using API from japan so my args path include some japanese(UTF-8) string.

 

I would appreciate it if the Dropbox team could look into this issue.

Thanks

Nico-Uretek
Helpful | Level 5

Thanks for your help ! That's right, Dropbox block now every special character and accents in the path name (not in accordance with the documentation haha). 

 

I hope this will solve soon ! 
Thanks simotin13

Здравко
Legendary | Level 20

@simotin13 wrote:

... --header "Dropbox-API-Arg: {\"path\":\"/aaa/あいうえお/sample.jpg\"}"

→ This request doesn't work. ...


Hi @simotin13,

This for sure wouldn't work. Dropbox doesn't support modern JSON encoding (RFC-8259) with UTF-8 inside! Dropbox supports the old JSON tagging style encoding only - take a look here. Just use some encoding tool instead of encode JSON by hand - jq on the command line for instance.

Hope this gives direction.

Greg-DB
Dropbox Staff

As Здравко mentioned, please make sure you're encoding header values as documented here: https://www.dropbox.com/developers/reference/json-encoding

Nico-Uretek
Helpful | Level 5

I'm correctly encoded. 
I forgot to say that the API is used in an application in prod. I didnt modify the code since months. 

Thanks greg

simotin13
Helpful | Level 5

Hi @Greg-DB @Здравко 

I checked link page about json-encoding.

I tried "HTTP-header-safe JSON" style and It certainly worked well.

Thank you for your support so quickly!

Greg-DB
Dropbox Staff

Thanks for confirming simotin13!

Greg-DB
Dropbox Staff

@Nico-Uretek If you're still seeing an issue when applying the encoding as documented, please share the specific steps, code, and parameter value(s) needed to reproduce the issue you're seeing so we can look into it. Be sure to redact any access/refresh tokens though. Thanks!

Need more support?