Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
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