Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I am trying to execute the API calls for Power BI on Postman. I was able to successfully generate the token using the service principal method. Now when I try and execute a GetDataset call in Postman it gives me an error "API is not accessible for application".
My perception is that i missed on some specific permission for postman in Power BI or Azure. The online docs and articles didn't say much about the postman specific permission but I might be wrong in presuming that.
Any help with this is greatly appreciated.
Let me know if you have any questions.
Thanks & Regards,
Vivin
Solved! Go to Solution.
I was able to find the reason why. This was because I was trying to work on the data form My Org and this is a limitation in the Service Principal method:
Considerations and limitations
My Workspace isn't supported when using service principal.
I am sorted now thanks for teh help.
The URL in the Microsoft API documentation is wrong for service principals.
You need to also include the workspace ID in the URL, see below
https://api.powerbi.com/v1.0/myorg/groups/{WorkspaceID}/reports/{reportId}/exports
For me as well, thanks! But c'mon how is one supposed to find this...? Trial and error?
This fixed the issue for me. Thanks a lot!
Hi @vivinj ,
First of all, Postman is just a tool and doesn't require specific permissions in order to use to Power BI API.
I think your Authorization token was generated with some restrictions.
When you registered an App, did you select all options?
For one time you can get an Authorization token with full rights simply via Chrome Developer Tools (F12) or other similar:
1. Open Power BI Service in Chrome Browser.
2. Press F12. DevTools window should appear.
3. Navigate in Power BI Service to any workspace. (If you were there, then redo, just need to run this action)
4. Go to DevTools -> Network tab , try to find any request, where Headers contain authorization. And that will be your Authorization token (valid for an hour).
On the screen shot below I found a request called 'SharedDatasets'. But for instance, 'subsribe' also a good one.
So I got a token, then I go to Postman and everythin works properly:
So I recommend to try to run your request using a method I provided, just to verify if your API request is written properly. And then if that works you can correct an App in Azure with proper permissions.
Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
@zoloturu thanks for the response. The Get call worked exactly as you said if I use the token form the Network logs and the call was successful.
My Problem now is which/where am I missing the permission that will allow me to us the the token that i generate rather than pulling it up from Network logs? I remember selecting all the permissions when I registered the app and the Azure portal has also has the necessary rights for my app to make the call successfully. So not sure what am i missing here.
Thanks & Regards,
Vivin
@vivinj ,
Let's try to collect a Fiddler trace.
1. If you don't have it, then install - https://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/InstallFiddler
2. Open Fiddler
3. Select "Edit -> Remove -> All Sessions"
4. Reproduce the issue in your Postman
5. There should be some red lines when API request runs. Post a screen shot of that.
Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
Facing this error in fiddler. HTTPS handshake failed
I was able to find the reason why. This was because I was trying to work on the data form My Org and this is a limitation in the Service Principal method:
Considerations and limitations
My Workspace isn't supported when using service principal.
I am sorted now thanks for teh help.
Hi, I've got the same issue. What did you replace the "MyOrg" with?
I alos met this problem. Thanks for your sharing. It works when using workspace API.
Do you know what should be added when using APP API: https://learn.microsoft.com/en-us/rest/api/power-bi/apps/get-reports
Service principal authentication isn't supported.
Don't know why Power BI has this kind of limitation.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
37 | |
29 | |
17 | |
13 | |
8 |
User | Count |
---|---|
48 | |
39 | |
33 | |
17 | |
16 |