Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
When I send my auth code it returns 'undefined'. I don't even get an error message. I can set this up in Postman and get a response.
axios({
method : 'post',
url : 'https://api.dropboxapi.com/oauth2/token',
params :
{
code : request.body.code,
grant_type : 'authorization_code',
redirect_uri : 'http://localhost:9000/calback',
client_id : '###########',
client_secret : '##########'
},
headers : { "Content-Type" : "application/json" }
})
.then(function(req, res)
{
console.log(res)
response.send(JSON.parse(res));
})
.catch(function(error)
{
console.log(error);
response.status(500).send(error);
});
I just gave this a try and it looks like the Dropbox API itself is working properly.
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.)
So, you'll probably want to do something like this instead:
.then(function(res) { console.log(res.data) // ...whatever you need to do with that here })
I just gave this a try and it looks like the Dropbox API itself is working properly.
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.)
So, you'll probably want to do something like this instead:
.then(function(res) { console.log(res.data) // ...whatever you need to do with that here })
That was it! I was reading the wrong response from the server.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!