cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kpratik
Frequent Visitor

Update embed token using javascript

Hello All,

 

I am embeding power bi reports on my website using APPS OWNED DATA.

Steps which I have followed is

1. Get Access token - Using https://login.microsoftonline.com/common/oauth2/token REST API

2. Get Embed token - Using  https://api.powerbi.com/v1.0/myorg/groups/<id>/reports/<id>/GenerateToken

 

After getting embed token rest everything works as expected.

Embed token expires after certain time interval, I wanted to know how can I update embed token using JavaScript?

I followed this article https://github.com/Microsoft/PowerBI-JavaScript/wiki/Refresh-token-using-JavaScript-SDK-example and I got following error:

 

Uncaught ReferenceError: generateEmbedToken is not defined

 

Thanks in advance.

2 REPLIES 2
v-micsh-msft
Microsoft
Microsoft

Where did you put the refresh token example in your code?

 

As the document statys, the generateEmbedToken is a function you need to implement with.

Basically, the generateEmbedToken should follow the scenario of the GenerateToken function, and you need to get the AccessToken first:

GenerateToken 

https://msdn.microsoft.com/library/mt784614.aspx

 

I haven't found any code sample for that.

 

 

Regards,

Michael

Does anybody have an example for this?

I am having the same issue and dont understand how shoul;d i implement the generateEmbedToken function

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Kudoed Authors