<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: download file API stopped working with 400 error in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/download-file-API-stopped-working-with-400-error/m-p/211432#M10621</link>
    <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/42755495/dropbox-download-file-api-stopped-working-with-400-error" target="_blank"&gt;https://stackoverflow.com/questions/42755495/dropbox-download-file-api-stopped-working-with-400-error&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error message is indicating that the access token isn't being supplied with the request properly. I can't offer much help with using the HTTP client in Angular, but here's a simplified version that works for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;let headers = new Headers();
headers.append('Authorization', 'Bearer &amp;lt;ACCESS_TOKEN&amp;gt;');
headers.append('Dropbox-API-Arg','{"path": "/test.txt"}');
console.log(headers);
http.post('https://content.dropboxapi.com/2/files/download', null,
    new RequestOptions(
        {
            headers: headers,
            responseType: ResponseContentType.ArrayBuffer}
        )
    )
.subscribe((res) =&amp;gt; {console.log(res)});&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There were two main options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You were passing the request options to the&amp;nbsp;data parameter, instead of the config parameter of http.post.&lt;/LI&gt;
&lt;LI&gt;You weren't passing in valid JSON as the&amp;nbsp;'Dropbox-API-Arg' value.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2017 18:33:09 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-03-13T18:33:09Z</dc:date>
    <item>
      <title>download file API stopped working with 400 error</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/download-file-API-stopped-working-with-400-error/m-p/211317#M10617</link>
      <description>&lt;P&gt;I use download file API , and i got a token , but it's return 400 bea request error&lt;BR /&gt;"Error in call to API function "files/download": Must provide HTTP header "Authorization" or URL parameter "authorization"&lt;/P&gt;
&lt;P&gt;How do I fix it ?&lt;/P&gt;
&lt;P&gt;this is my code ( angular2 )&lt;/P&gt;
&lt;PRE&gt;downloadFile(fileid){
let headers = new Headers();
headers.append('Authorization', 'Bearer ' + this.accessToken);
headers.append('Dropbox-API-Arg','path:'+ fileid);
return this.http.post('https://content.dropboxapi.com/2/files/download',new RequestOptions({ headers: headers ,responseType:ResponseContentType.ArrayBuffer})).map((res) =&amp;gt; {
let arrayBuffer = res.arrayBuffer();
let contentType = res.headers.get('content-type');
return {
fileid: fileid,
blob: new Blob([arrayBuffer], { type: contentType })
};
});&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:24:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/download-file-API-stopped-working-with-400-error/m-p/211317#M10617</guid>
      <dc:creator>wind75423</dc:creator>
      <dc:date>2019-05-29T09:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: download file API stopped working with 400 error</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/download-file-API-stopped-working-with-400-error/m-p/211432#M10621</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/42755495/dropbox-download-file-api-stopped-working-with-400-error" target="_blank"&gt;https://stackoverflow.com/questions/42755495/dropbox-download-file-api-stopped-working-with-400-error&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error message is indicating that the access token isn't being supplied with the request properly. I can't offer much help with using the HTTP client in Angular, but here's a simplified version that works for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;let headers = new Headers();
headers.append('Authorization', 'Bearer &amp;lt;ACCESS_TOKEN&amp;gt;');
headers.append('Dropbox-API-Arg','{"path": "/test.txt"}');
console.log(headers);
http.post('https://content.dropboxapi.com/2/files/download', null,
    new RequestOptions(
        {
            headers: headers,
            responseType: ResponseContentType.ArrayBuffer}
        )
    )
.subscribe((res) =&amp;gt; {console.log(res)});&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There were two main options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You were passing the request options to the&amp;nbsp;data parameter, instead of the config parameter of http.post.&lt;/LI&gt;
&lt;LI&gt;You weren't passing in valid JSON as the&amp;nbsp;'Dropbox-API-Arg' value.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 18:33:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/download-file-API-stopped-working-with-400-error/m-p/211432#M10621</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-03-13T18:33:09Z</dc:date>
    </item>
  </channel>
</rss>

