<?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: Dropbox oath2/token returns undefined in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-oath2-token-returns-undefined/m-p/417309#M22473</link>
    <description>&lt;P&gt;That was it! I was reading the wrong response from the server.&lt;/P&gt;</description>
    <pubDate>Tue, 05 May 2020 18:09:17 GMT</pubDate>
    <dc:creator>TheKrominator</dc:creator>
    <dc:date>2020-05-05T18:09:17Z</dc:date>
    <item>
      <title>Dropbox oath2/token returns undefined</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-oath2-token-returns-undefined/m-p/417083#M22461</link>
      <description>&lt;P&gt;When I send my auth code it returns 'undefined'. I don't even get an error message.&amp;nbsp; I can set this up in Postman and get a response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;axios({&lt;BR /&gt;method : 'post',&lt;BR /&gt;url : '&lt;A href="https://api.dropboxapi.com/oauth2/token" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/oauth2/token&lt;/A&gt;',&lt;BR /&gt;params :&lt;BR /&gt;{&lt;BR /&gt;code : request.body.code,&lt;BR /&gt;grant_type : 'authorization_code',&lt;BR /&gt;redirect_uri : 'http://localhost:9000/calback',&lt;BR /&gt;client_id : '###########',&lt;BR /&gt;client_secret : '##########'&lt;BR /&gt;},&lt;BR /&gt;headers : { "Content-Type" : "application/json" }&lt;BR /&gt;})&lt;BR /&gt;.then(function(req, res)&lt;BR /&gt;{&lt;BR /&gt;console.log(res)&lt;BR /&gt;response.send(JSON.parse(res));&lt;BR /&gt;})&lt;BR /&gt;.catch(function(error)&lt;BR /&gt;{&lt;BR /&gt;console.log(error);&lt;BR /&gt;response.status(500).send(error);&lt;BR /&gt;});&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 23:20:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-oath2-token-returns-undefined/m-p/417083#M22461</guid>
      <dc:creator>TheKrominator</dc:creator>
      <dc:date>2020-05-04T23:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox oath2/token returns undefined</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-oath2-token-returns-undefined/m-p/417274#M22467</link>
      <description>&lt;P&gt;I just gave this a try and it looks like the&amp;nbsp;Dropbox API itself is working properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't officially provide support for axios, but it looks like the issue is the callback function definition you're using. The axios client apparently just returns a single result variable, not a pair of `req, res` like you're trying to use. (And so, `res` isn't defined.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you'll probably want to do something like this instead:&lt;/P&gt;
&lt;PRE&gt; .then(function(res) {
     console.log(res.data)
     // ...whatever you need to do with that here
 })&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 May 2020 15:33:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-oath2-token-returns-undefined/m-p/417274#M22467</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-05-05T15:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox oath2/token returns undefined</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-oath2-token-returns-undefined/m-p/417309#M22473</link>
      <description>&lt;P&gt;That was it! I was reading the wrong response from the server.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 18:09:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-oath2-token-returns-undefined/m-p/417309#M22473</guid>
      <dc:creator>TheKrominator</dc:creator>
      <dc:date>2020-05-05T18:09:17Z</dc:date>
    </item>
  </channel>
</rss>

