title: Getting data from restful API in Node (server to server) Node/Express Using Request
body: <p>I am trying to connect to TradeGecko API located here:
  (all their examples are in ruby - I am using Node)</p>
  
  <p><a href="http://developer.tradegecko.com/" rel="nofollow">http://developer.tradegecko.com/</a></p>
  
  <p>I have a privileged access token that I created
  FAKE TOKEN:
  146e29b59e7e8861f462101f610f58168ca5edf2f307e5f7adc3314d24ee8015</p>
  
  <p>How can I make a GET request to get all products for example:
  <a href="http://developer.tradegecko.com/?ruby#list-all-products" rel="nofollow">http://developer.tradegecko.com/?ruby#list-all-products</a></p>
  
  <p>The help is much appreciated!</p>
  
  <p>Let say I have some code like this:</p>
  
  <pre><code>var express = require('express');
  var request = require('request');
  
  var app = express();
  
  var port = process.env.PORT || 3000;
  
  
  var testRouter = express.Router();
  
  myRouter.route('/testRoute')
    .get(function(req, res){
      request('API CALL HERE??', function (error, response, body){
        if(!error &amp;&amp; response.statusCode == 200){
          res.json(body);
        }
      })
    });
  
  app.use('/api', bookRouter);
  
  var myRouter = express.Router();
  
  app.get('/', function(req, res){
    res.send('Welcome to my API');
  });
  
  app.listen(port, function() {
    console.log('GULP is running my app on PORT: ' + port);
  });
  </code></pre>