import React, { Component } from 'react';
import tableau from 'tableau-api';
class App extends Component {
componentDidMount() {
this.initViz()
}
initViz() {
const vizUrl = 'http://public.tableau.com/views/RegionalSampleWorkbook/Storms';
const vizContainer = this.vizContainer;
let viz = new window.tableau.Viz(vizContainer, vizUrl)
}
render() {
return (
<div ref={(div) => { this.vizContainer = div }}>
</div>
)
}
}
export default App;
it works when i publish my workbook to public tableau with extract data source
but when i publish the same in tableau with live data source(sql),
https:///#/site/testsite/views/genderanalysis/Sheet2?:iid=1
and that when i used here not working
and from the doc, i found api with unique-token https:// /trusted/%3CTRUSTED%20TICKET%20HERE%3E/t/testsite/views/genderanalysis/Sheet2?:embed=yes&:comments=no&:toolbar=yes&:refresh=yes&:embed=y&:showVizHome=n&:jsdebug=y&:bootstrapWhenNotified=y&:apiID=handler0
But i dont know how to generate unique-token
when i browse it on a website it shows token error
i used https:///trusted/ with username as param, but it always returns -1
im using trial version
Did this worked for anyone?