title: Keyclok Rest API using node.js
body: <p>I was trying to code a crud function for keyclok app. I am able to get token, use token and get user list but not create a user
  if someone can help me it will be very helpful for me</p>
  <p><strong>create user list (not working)</strong></p>
  <pre><code>function CreateKCUser(accessToken) {
   let url = `http://localhost:8080/auth/admin/realms/msportal/users`;
    return axios_instance.post(url,
      {
        headers: {
          &quot;content-type&quot;: &quot;application/json&quot;,
          &quot;authorization&quot;: `Bearer ${accessToken}`
        },
        data: {
          &quot;firstName&quot;: &quot;First&quot;,
          &quot;lastName&quot;: &quot;Last&quot;,
          &quot;email&quot;:&quot;test@test.com&quot;,
          &quot;enabled&quot;:&quot;true&quot;, 
          &quot;username&quot;:&quot;TEST-USER&quot;
        }}).then(function (response) {
          console.log('User Created');
      })
      .catch(function (error) {
        console.log('Error on Creation');
      });
  }
  </code></pre>
  <p><strong>get user list(working)</strong></p>
  <pre><code>function GetKCUser(email, accessToken) {
    let url = `http://localhost:8080/auth/admin/realms/msportal/users?email=${email}`;
    return axios_instance.get(url,
      {
        headers: {
          &quot;content-type&quot;: &quot;application/json&quot;,
          &quot;accept&quot;: &quot;application/json&quot;,
          &quot;authorization&quot;: `Bearer ${accessToken}`
        }
      });
  }
  </code></pre>
  <p><strong>function (token, get users working except user creation)</strong></p>
  <pre><code>http.createServer(function Test() {
    getAccessToken().then(function (response) {
      console.log('access_token=' + response.data.access_token);
      GetKCUser(&quot;shafeenes@gmail.com&quot;, response.data.access_token).then((resp) =&gt; {
        console.log(resp.data);
      });
      CreateKCUser(response.data.access_token).then((resp) =&gt; {
        console.log(resp);
  
      });
  
    }).catch(function (error) {
      // handle error
      console.log(error);
    })
      .then(function () {
        // always executed
      });;
  
  
  }).listen(8084);
  </code></pre>