title: Get all assets from RefTab API (Format RefTab API Response)
body: <p>I'm trying to use RefTab's API to pull custom reports, but I'm not sure how to pull the data I want from the response.</p>
  <p>I think it might have something to do with unzipping a gunzip?</p>
  <p>I've tried accessing res.headers and res.body, but it's not exactly what I'm looking for.</p>
  <p>I can't seem to find anything anywhere on RefTab specifically.
  I'm not experienced in using REST APIs so I don't know if this is specific to RefTab</p>
  <p>Any help would be greatly appreciated!</p>
  <p><a href="https://reftab.com" rel="nofollow noreferrer">https://reftab.com</a></p>
  <p><a href="https://reftab.com/api-docs" rel="nofollow noreferrer">https://reftab.com/api-docs</a></p>
  <p>My index.js file:</p>
  <pre><code>const btoa = require('btoa');
  const fetch = require('node-fetch');
  const CryptoJS = require('crypto-js');
  
  //CryptoJS is needed for the md5 and HmacSHA256 methods
  function signRequest(request) {
    const publicKey = 'PUBLIC_KEY_HERE';
    const secretKey = 'SECRET_KEY_HERE';
    const body = request.body;
    const method = request.method;
    const url = request.url;
    const now = new Date().toUTCString();
    let contentMD5 = '';
    let contentType = '';
    if (body !== undefined) {
      contentMD5 = CryptoJS.md5(body).toString();
      contentType = 'application/json';
    }
    let signatureToSign = method + '\n' +
      contentMD5 + '\n' +
      contentType + '\n' +
      now + '\n' +
      url;
    signatureToSign = unescape(encodeURIComponent(signatureToSign));
    const token = btoa(CryptoJS.HmacSHA256(signatureToSign, secretKey));
    const signature = 'RT ' + publicKey + ':' + token;
    request.headers = {};
    request.headers.Authorization = signature;
    request.headers['x-rt-date'] = now;
    return request;
  }
  
  //expected input object
  const options = {
    method: 'GET',
    url: 'https://www.reftab.com/api/assets'
  };
  fetch('https://www.reftab.com/api/assets', signRequest(options))
    .then((res) =&gt; {
      console.log(res);
    });
  </code></pre>
  <p>The response:</p>
  <pre><code>Response {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: {
      body: Gunzip {
        _writeState: [Uint32Array],
        _readableState: [ReadableState],
        readable: true,
        _events: [Object: null prototype],
        _eventsCount: 6,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: true,
        allowHalfOpen: true,
        _transformState: [Object],
        _hadError: false,
        bytesWritten: 0,
        _handle: [Zlib],
        _outBuffer: &lt;Buffer a0 ac 36 be 49 02 00 00 e0 46 33 be 49 02 00 00 6e 5b b1 6b 01 09 00 00 8c 21 00 00 36 09 00 00 30 87 34 be 49 02 00 00 f0 7d 34 be 49 02 00 00 62 69 ... 16334 more bytes&gt;,
        _outOffset: 0,
        _chunkSize: 16384,
        _defaultFlushFlag: 2,
        _finishFlushFlag: 2,
        _defaultFullFlushFlag: 3,
        _info: undefined,
        _level: -1,
        _strategy: 0,
        [Symbol(kCapture)]: false
      },
      disturbed: false,
      error: null
    },
    [Symbol(Response internals)]: {
      url: 'https://www.reftab.com/api/assets',
      status: 200,
      statusText: 'OK',
      headers: Headers { [Symbol(map)]: [Object: null prototype] },
      counter: 0
    }
  }
  </code></pre>