Reputation: 109
I am posting following data to [https://login.uber.com/oauth/v2/token] my code:-
var postData = {
url:'https://login.uber.com/oauth/v2/token',
headers:{"Authorization":"Token "+uberServerToken},
qs:{
client_secret:uberClientSecret,
client_id:uberClientID,
grant_type:'authorization_code',
redirect_uri:redirectURIforAccessToken,
code:req.query.code
}
};
request.post(postData,function(err, response, body){
if(err){
console.log("Error @ POSTING:"+err);
}else {
console.log("body:"+body);
res.end();
}
});
but it is giving me response as {"error": "invalid_client"}
Upvotes: 0
Views: 737
Reputation: 797
Use this node wrapper for the Uber API. It appears to be the most advanced one and I recently added support for payment-methods
and places
.
You can also check out my sample code from Take Me Home Now!
Upvotes: 2
Reputation: 701
use a package that supports oauth. It will be easier to deal with
Upvotes: 0