Forum Discussion
JinJia
9 years agoNew Member
Integrate PowerBI with Netsuite
Hi, devs I'm currently integrating PowerBI with Netsuite. I'm facing an issue. I want to know the way to get access token with Javascript API. Looking forward to hearing from you asap. ...
Eric_Zhang
9 years agoMicrosoft Employee
Then my approach would be using Power BI Embedded, check Power BI emebedded VS Rest API.
- Import the records to powerbi desktop,design the report and upload it to a workspace. Regarding data refreshing, check this link.
- Generate an accesstoken that never expires(not recommended).
var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id,Convert.ToDateTime("2099-12-31")); - Embed the report with PowerBI-Javascript. You can save the below sample in a html file and run in brower, my token in this test wouldn't expire before 2018 year.
<html>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/jquery/dist/jquery.js"></script>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/powerbi-client/dist/powerbi.js"></script>
<script type="text/javascript">
window.onload = function () {
var embedConfiguration = {
type: 'report',
accessToken: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXIiOiIwLjIuMCIsIndjbiI6IndvcmtzcGFjZUNvbGxlY3Rpb240UEJJIiwid2lkIjoiYjVkMDJiYmItODcxNy00MmJlLWEzMTMtZDEyYTdmYzk0OTcyIiwicmlkIjoiMjlhNDcxNGYtYzQzMi00ZjEwLTk5ZTMtNzA1MzhmNGJlYmUwIiwiaXNzIjoiUG93ZXJCSVNESyIsImF1ZCI6Imh0dHBzOi8vYW5hbHlzaXMud2luZG93cy5uZXQvcG93ZXJiaS9hcGkiLCJleHAiOjE1MTQ2NDk2MDAsIm5iZiI6MTQ4MDAyOTQ4Nn0.GC1iQa1Xghkp9o4R87DcRjaLe9a0PBN7wxYOJKFDd5Y',
id: '29a4714f-c432-4f10-99e3-70538f4bebe0',
embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed?reportId=29a4714f-c432-4f10-99e3-70538f4bebe0'
};
var $reportContainer = $('#reportContainer');
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
}
</script>
<div id="reportContainer"></div>
</html>
Anonymous
9 years agoNot applicable
Check out our solution for this...
https://www.youtube.com/watch?v=dbOQDLZi1Xc&t=5s
e-mail me for more details
-Josh