title: REST API calls using async await
body: <p>Here's my code snippet</p>
  
  <pre><code>var clients = require('restify-clients');
  
  async function callApi(val){
          const client = clients.createJsonClient({ url: apiUrl });
          await client.get('/my/url', (err, req, res, obj) =&gt; {
              if (err) {
                  return err;
              } else {
                  return obj;
              }
          });
  }
  </code></pre>
  
  <p>I've tried a few ways of calling it, but they all aren't working</p>
  
  <p>First way:</p>
  
  <pre><code>var results = await callApi(val);
  </code></pre>
  
  <p>Second way:</p>
  
  <pre><code>var results = callApi(val).then(data =&gt; {
                  console.log(data);
              })
  </code></pre>