Tag: freelancer.com api

令牌在获取访问令牌时已经使用了错误

我正在尝试设置node.js应用程序使用OAuth2.0使用Elance API我正在使用passport.js连接到elance API,到目前为止我们能够正确获取代码。 在使用api方法之前,我需要使用post请求获取请求令牌 。 但是,我收到了“ 已使用的代码 ”错误。 这是我的callback代码 app.get('/callback', passport.authenticate('elance', { failureRedirect: '/failure' }), function(req, res) { console.log('CODE : ' + req.query.code); // this is getting displayed properly var payload = { code: req.query.code, grant_type:'authorization_code', client_id: auth.CLIENT_ID, client_secret: auth.CLIENT_SECRET }; request.post('https://api.elance.com/api2/oauth/token/', payload) .then(function(response) { var x = response.getBody(); console.log('resp::::'+x); res.redirect('/success'); }); }); 我正在使用requestify执行发布请求,并没有使用/调用临时代码的服务器。 这是生成的错误: […]