Tableau REST API: Using Javascript to get the Token -
i complete beginner rest api , not figure out how proceed. installed postman , able token, not sure how send raw xml payload in javascript.
<tsrequest> <credentials name ="xxx" password="yyy" > <site contenturl = "" /> </credentials> </tsrequest>
i have :
httprequest.open('post', 'http://my-server/api/2.4/auth/signin', false); httprequest.setrequestheader("content-type", "application/xml");
not sure how add xml payload. have access tableau server(my-server) , everything. appreciated!
thank you!
you getting closer, need use send
method send xml: https://developer.mozilla.org/en-us/docs/web/api/xmlhttprequest/send
just make sure xml encoded in javascript when you're inputting it. if using double quotes inside xml, make sure have single quotes declare string in javascript (e.g.) var data = '<credentials name="xxx" >';
related: send post data using xmlhttprequest
Comments
Post a Comment