Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
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
It all depends on your setup and where you generate your tokens.
If using PowerBI embedded, you probably have a backend to handle token generation and token refresh, so you'll have to make a POST request to your back-end endpoint with the reportId (and maybe groupId) and that should return your new token data.
I don't think you can get an embed token dynamically from the endpoint you mentioned at point 2 in the initial post, which I believe is what you're trying to get an example for.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |