title: Why do I get this error when trying to get my past paypal transactions?
body: <p>I am trying to read my past transactions. I have already done that with the curl tool, but I can't get it working in nodeJS. I am trying this with the request api. Getting the token from paypal works just fine. Just can't figure out to do this</p>
  <pre><code>curl -v -X GET https://api.paypal.com/v1/reporting/transactions?start_date=2020-05-20T01:01:01-00:00&amp;end_date=2020-06-19T01:01:01-00:00 \
    -H &quot;Content-Type: application/json&quot; \
    -H &quot;Authorization: Bearer access-token&quot;
  </code></pre>
  <p>in NodeJS currently I have this. Can someone help me pls figuring it out?</p>
  <pre><code>var request = require('request');
  
  let token;
  
  request.post({
      uri: &quot;https://api.paypal.com/v1/oauth2/token&quot;,
      headers: {
          &quot;Accept&quot;: &quot;application/json&quot;,
          &quot;Accept-Language&quot;: &quot;en_US&quot;,
          &quot;content-type&quot;: &quot;application/x-www-form-urlencoded&quot;
      },
      auth: {
          'user': client_id,
          'pass': secret,
      },
      form: {
          &quot;grant_type&quot;: &quot;client_credentials&quot;
      }
  }, function (error, response, body) {
      let resp = JSON.parse(body);
      token = resp.access_token;
      console.log(token)
      if (error)
          console.log(error)
  
      getTransactions();
  });
  
  
  function getTransactions() {
      if (!token) {
          console.error(&quot;Could not get token&quot;);
          return;
      }
  
  
      request.post({
          uri: &quot;https://api.paypal.com/v1/reporting/transactions?start_date=2020-05-20T01:01:01-00:00&amp;end_date=2020-06-19T01:01:01-00:00&quot;,
          headers: {
              &quot;content-type&quot;: &quot;application/json&quot;
          },
          auth: {
              bearer: token,
          }
      }, function (error, response, body) {
          console.log(body);
          console.log(error)
          console.log(JSON.stringify(response))
  
      });
  }
  </code></pre>
  <p>The Error:</p>
  <pre><code>&quot;statusCode&quot;:404,&quot;body&quot;:&quot;&quot;,&quot;headers&quot;:{&quot;content-length&quot;:&quot;0&quot;,
  &quot;connection&quot;:&quot;close&quot;,&quot;date&quot;:&quot;Sun, 21 Jun 2020 00:35:15 GMT&quot;,
  &quot;cache-control&quot;:&quot;max-age=0, no-cache, no-store, must-revalidate&quot;,
  &quot;paypal-debug-id&quot;:&quot;207f5d4c9341&quot;,
  &quot;strict-transport-security&quot;:&quot;max-age=31536000; includeSubDomains&quot;},&quot;request&quot;:{&quot;uri&quot;:{&quot;protocol&quot;:&quot;https:&quot;,&quot;slashes&quot;:true,&quot;auth&quot;:null,
  &quot;host&quot;:&quot;api.paypal.com&quot;,&quot;port&quot;:443,&quot;hostname&quot;:&quot;api.paypal.com&quot;,
  &quot;hash&quot;:null,
  &quot;search&quot;:&quot;?start_date=2020-05-20T01:01:01-00:00&amp;end_date=2020-06-19T01:01:01-00:00&quot;,
  &quot;query&quot;:&quot;start_date=2020-05-20T01:01:01-00:00&amp;end_date=2020-06-19T01:01:01-00:00&quot;,
  &quot;pathname&quot;:&quot;/v1/reporting/transactions&quot;,
  &quot;path&quot;:&quot;/v1/reporting/transactions?start_date=2020-05-20T01:01:01-00:00&amp;end_date=2020-06-19T01:01:01-00:00&quot;,
  &quot;href&quot;:&quot;https://api.paypal.com/v1/reporting/transactions?start_date=2020-05-20T01:01:01-00:00&amp;end_date=2020-06-19T01:01:01-00:00&quot;},
  &quot;method&quot;:&quot;POST&quot;,&quot;headers&quot;:{&quot;Accept&quot;:&quot;application/json&quot;,
  &quot;Accept-Language&quot;:&quot;en_US&quot;,&quot;content-type&quot;:&quot;application/x-www-form-urlencoded&quot;,
  &quot;authorization&quot;:&quot;Bearer accesstoken_is_my_little_secret&quot;,
  &quot;content-length&quot;:0}}}
          index.js:38
  </code></pre>