title: Tableau REST API: Using Javascript to get the Token
body: <p>I am a complete beginner with REST API and I could not figure out how I am to proceed.
  I installed Postman and was successfully able to get the Token, but I am not sure how to send the raw XML payload in javascript.</p>
  
  <pre><code> &lt;tsRequest&gt;
        &lt;credentials name ="XXX" password="YYY"  &gt;
             &lt;site contenturl = "" /&gt;
        &lt;/credentials&gt;
   &lt;/tsRequest&gt;
  </code></pre>
  
  <p>I have :</p>
  
  <pre><code> httpRequest.open('POST', 'http://MY-SERVER/api/2.4/auth/signin', false);
   httpRequest.setRequestHeader("Content-type", "application/xml");
  </code></pre>
  
  <p>Not sure how to add the xml payload. I have access to a Tableau Server(MY-SERVER) and everything.
  Any help would be greatly appreciated!</p>
  
  <p>Thank you!</p>