title: How to make a REST API call from Microsoft Bot for Teams using node js?
body: <p>I have created a Microsoft Bot using the following documentation
  <a href="https://docs.microsoft.com/en-us/microsoftteams/platform/toolkit/visual-studio-code-overview" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/microsoftteams/platform/toolkit/visual-studio-code-overview</a> .
  Now what I want to achieve is if user enters &quot;show data&quot; in the chat, I want to display the data which I will get from an API endpoint in JSON format.
  I have tried the following code creating a new file named <code>getData.js</code> :</p>
  <pre><code>const axios = require('axios');
  
  class getData {
      async getDataJson() {
  
          const config = {
              method: 'get',
              url: 'https://someurl',
              headers: { 'name': 'user_name', 'token': 'token' }
          }
  
          let res = await axios(config);
      
          let data = res.data;
      
          return data;
      }
  }
  
  module.exports.getData = getData;
  </code></pre>
  <p>If this method is correct, how do I use it to send reply to the user the result data ?Also how do I populate the headers which should be the email and token generated using the SSO authentication method used in <code>dialog/mainDialog.js</code>?</p>