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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Irshad_aj
New Member

Forbidden Issue with PowerBiClient

Hi Geeks,
Currently I am working with Power Bi apis and embedding. I have tried to get embed token using powerBi client by pbiClient.Reports.GenerateTokenAsync() method. But I got exception , says "Operation returned an invalid status code 'Forbidden'" .
I have given 'workspaceId', 'reportId', 'tokenRequest ' as parameters. wokspaceId and reportId are correct. tokenRequest is a GenerateTokenRequest object and value of it when it passes to pbiClient.Reports.GenerateTokenAsync() method is :

AccessLevel : {View}
AllowSaveAs : null
DatasetId : //a dataset id
Identities : null
LifetimeInMinutes : null

 

Do I have to enable something while creating or publishing report for embed a pbi report either in PowerBi Desktop or in my code ?
What do you think about the conditions to get that exception ?

Did I miss any any information ? please let me know.

Note:
**I am incharge for generate tokens, embedURLs etc and, powerBi report making and publishing is done by some one else**
My project have already embedded so many report as far. I am experiencing this issue while trying to adding/embedding newly created Bi reports.
Woking on .NET6

 

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.