title: Got a non-object result, expected an object from create Zapier?
body: <p>I am getting the buffer by <code>request</code> module of NPM &amp; from that buffer i am parsing the pdf with another module <code>pdf-parse</code>. While executing the zap i am getting the error as:</p>
  
  <blockquote>
    <p>Unhandled error: CheckError: Invalid API Response:
      - Got a non-object result, expected an object from create ()</p>
  </blockquote>
  
  <p>Below is my code for action</p>
  
  <pre><code>var utils = require('../utils/utils.js')
  const pdf = require('pdf-parse');
  var isMetaData = false;
  var request = require('request').defaults({ encoding: null });
  let a = {}
  
  const register = (z, bundle) =&gt; {
      var url = bundle.inputData.value
      getMetaData(url, z).then((a) =&gt; {
          return a
      });
      z.console.log("Process started")
  
  };
  
  
  function getMetaData(url, z) {
      z.console.log("In getmetadata");
  
      return new Promise((resolve, reject) =&gt; {
          request({ url, encoding: null }, (err, resp, buffer) =&gt; {
              z.console.log("In request response");
  
              pdf(buffer).then(function (data) {
                  var mdata = data.metadata;
                  var filtered = {}
                  for (key in mdata._metadata) {
                      if (key.match(/^pdfx:blockchain/)) filtered[key] = mdata[key];
                  }
                  if (Object.keys(filtered).length === 1) {
                      isMetaData = true
                  }
                  a.isMetaData = isMetaData
                  resolve(a);
                  z.console.log("a value set");
              });
          });
      });
  }
  </code></pre>
  
  <p>Logs for Zap:</p>
  
  <pre><code>- - - - - - - - - - - - - - - - - - 
  
  == Log
  Process started
  == Version
  0.1.6
  == Step
  50c914b6-03be-49ee-bd94-469e81811578
  == Timestamp
  2019-08-18T06:13:49-05:00
  
   - - - - - - - - - - - - - - - - - - 
  
  == Log
  In getmetadata
  == Version
  0.1.6
  == Step
  50c914b6-03be-49ee-bd94-469e81811578
  == Timestamp
  2019-08-18T06:13:49-05:00
  
   - - - - - - - - - - - - - - - - - - 
  
  == Log
  Unhandled error: CheckError: Invalid API Response:
    - Got a non-object result, expected an object from create ()
  What happened:
    Executing creates.register.operation.perform with bundle
    Invalid API Response:
    - Got a non-object result, expected an object from create ()
  CheckError: Invalid API Response:
    - Got a non-object result, expected an object from create ()
      at checkOutput (:censored:9:d1ba0cf2aa:/node_modules/zapier-platform-core/src/app-middlewares/after/checks.js:37:15)
      at Object.collector.then.newOutput (:censored:9:d1ba0cf2aa:/node_modules/zapier-platform-core/src/middleware.js:80:37)
      at bound (domain.js:301:14)
      at Object.runBound (domain.js:314:12)
      at Object.tryCatcher (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/promise.js:512:31)
      at Promise._settlePromise (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/promise.js:569:18)
      at Promise._settlePromiseCtx (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/promise.js:606:10)
      at Async._drainQueue (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/async.js:138:12)
      at Async._drainQueues (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/async.js:143:10)
      at Immediate.Async.drainQueues (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/async.js:17:14)
      at runCallback (timers.js:794:20)
      at tryOnImmediate (timers.js:752:5)
      at processImmediate [as _immediateCallback] (timers.js:729:5)
  == Version
  0.1.6
  == Step
  sdf-03be-49ee-bd94-463481811578
  == Timestamp
  2019-08-18T06:13:49-05:00
  
   - - - - - - - - - - - - - - - - - - 
  
  == Log
  In request response
  == Version
  0.1.6
  == Step
  ddwrr345e-sad-49ee-bd94-fsd34535
  == Timestamp
  2019-08-18T06:13:49-05:00
  </code></pre>