<?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: DropboxResponseError: Response failed with a 401 code in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DropboxResponseError-Response-failed-with-a-401-code/m-p/679234#M30572</link>
    <description>&lt;P&gt;In your JavaScript code, you're using the token as an access token, however in your .NET code, you're using the token as a refresh token. Access tokens and refresh tokens are different objects and are not interchangeable, so you can't use the same token both ways like that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the token you have is a refresh token, you should supply it to &lt;A href="https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#Dropbox__anchor" target="_blank"&gt;the JavaScript SDK Dropbox constructor&lt;/A&gt; using the "refreshToken" parameter (not "accessToken").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I have now redacted them, but you posted your credentials here publicly. These credentials enable access to the connected account, and so as a matter of security should not be shared. That being the case, you may want to revoke them now since they're been exposed.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 19:48:19 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2023-04-24T19:48:19Z</dc:date>
    <item>
      <title>DropboxResponseError: Response failed with a 401 code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DropboxResponseError-Response-failed-with-a-401-code/m-p/679225#M30571</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;I get an error 401 trying to connect to my dropbox, this is my code:&lt;/P&gt;
&lt;P&gt;let dbx = new Dropbox.Dropbox({ accessToken: "REDACTED", clientId: "REDACTED", clientSecret: "REDACTED" });&lt;BR /&gt;&amp;nbsp;dbx.filesListFolder({ path: "" })&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.then(function (response) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (response.result.entries &amp;gt; 1) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;})&lt;BR /&gt;.catch(function (error) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(error);&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;the same credentials works perfect on the server side in C#:&lt;/P&gt;
&lt;P&gt;var dbx = new DropboxClient(DropBoxClass.Refresh_Token, DropBoxClass.Appkey, DropBoxClass.Appsecret);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 19:36:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DropboxResponseError-Response-failed-with-a-401-code/m-p/679225#M30571</guid>
      <dc:creator>brtdvrs</dc:creator>
      <dc:date>2023-04-24T19:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: DropboxResponseError: Response failed with a 401 code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DropboxResponseError-Response-failed-with-a-401-code/m-p/679234#M30572</link>
      <description>&lt;P&gt;In your JavaScript code, you're using the token as an access token, however in your .NET code, you're using the token as a refresh token. Access tokens and refresh tokens are different objects and are not interchangeable, so you can't use the same token both ways like that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the token you have is a refresh token, you should supply it to &lt;A href="https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#Dropbox__anchor" target="_blank"&gt;the JavaScript SDK Dropbox constructor&lt;/A&gt; using the "refreshToken" parameter (not "accessToken").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I have now redacted them, but you posted your credentials here publicly. These credentials enable access to the connected account, and so as a matter of security should not be shared. That being the case, you may want to revoke them now since they're been exposed.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 19:48:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DropboxResponseError-Response-failed-with-a-401-code/m-p/679234#M30572</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-04-24T19:48:19Z</dc:date>
    </item>
  </channel>
</rss>

