title: getting user list from slack API using NodeJS
body: <p>I am creating a slack bot and am trying to get the list of members in a slack workspace. Below is my code.</p>
  
  <pre><code>getUserList() {
      axios.get(`https://slack.com/api/users.list?token=`+process.env.SLACK_BOT_TOKEN).then((res) =&gt; {      
        var jsonParsed = JSON.parse(res);
        for (i = 0; i &lt; jsonParsed; i++) {
          workspace_users.push(jsonParsed[i].name); 
        }
      });
    },
  </code></pre>
  
  <p>I am getting below response. </p>
  
  <pre><code>{"ok":true,"no_op":true,"already_open":true,"channel":{"id":"*****"},"scopes":["identify","bot:basic"],"acceptedScopes":["im:write","post"]}
  </code></pre>
  
  <p>I went to <a href="https://api.slack.com/methods/users.list" rel="nofollow noreferrer">https://api.slack.com/methods/users.list</a> and I am not getting the kind of result mention in the URL.</p>
  
  <p>I have already given the scope permission to my bot.</p>
  
  <p>Any help would be appreciated.</p>