Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
ronnoc
Advocate II
Advocate II

Setting up javascript api - the perpetual mystery of access tokens

Cheers to everyone in the community who has helped with everything so far.

 

I really need some directions on finding the necessary authentication credentials to embed a report within the new javascript API, as mentioned in posts by others@PaulFowler; I have found that the api documentation includes a detailed walk through of everything 'except the definition and set up of authentication credentials which is a pretty crucial part.

 

The sample here works brilliantly (I love that there is print options) and the code is straight forward. I know these are the variables I need: and this is my current situation on tracking them down.

 

Access token: virtually no idea where to find this, absolutely no clue

Type: "report"

ID: Comes from the workspace ID in Azure I think? eg "c52af8ab-0468-4165-92af-dc39858d66ad" 

Name: I assume is just the name of the embedded report 

WebURL & embedURL: I am hoping come from the same place in PBI service (File>Publish to web)

 

 

There may be something obvious that I am missing but I have now spent far too much time scratching my beard with no results.

 

Any responses will be highly appreciated.

 

Javascript API Wiki

 

Microsoft documentation

 

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee

@ronnoc

 

No magic to get the token but in code.

 

To get access token for REST API, check Sample C# code to get access token, and get report.
To get access token for Power BI Emebeded, check this reply.

 

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee

@ronnoc

 

No magic to get the token but in code.

 

To get access token for REST API, check Sample C# code to get access token, and get report.
To get access token for Power BI Emebeded, check this reply.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.