Forum Discussion
M function to read from api.powerbi.com
Hi TePe ,
Which information you need to read from api.powerbi.com? Could you please provide more detail? Thank you.
Best Regards
Rena
- TePe6 years agoHelper IV
Hi,
I need the list of workspaces with their users... So I wanted to use this API:
https://api.powerbi.com/v1.0/myorg/admin/groups?$expand=users&$top=100
I tried it via M code and the Web data source, but how to authenticate?
Thanks,
Thomas
- Anonymous6 years agoNot applicable
Hi TePe ,
How did you connect to that API? And whether you get any error when connected? If yes, could you please provide the related screen shot?
In addition, please check if the following blogs can help you.
how to connect my web api wtih Power BI Reports?
Why is it so complex to connect to an API with Power BI or Power Query? The OAuth explained
ACCESS TO THE RESOURCE IS FORBIDDEN ON POWER BI DESKTOP
Best Regards
Rena
- TePe6 years agoHelper IV
Hi,
I'm trying two different way...
One is simply using the web source and using something like https://api.powerbi.com/v1.0/myorg/groups as a source.
The alternative is that I use a M script like this:
(MyDomain as text) =>
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/" & MyDomain & "/admin/groups?$expand=users&$top=100")),
value = Source[value],
fnGetWorkspaceUsers = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in fnGetWorkspaceUsersAt the end it's boiling down to the question how to authenticate. "Organizational Account" gives me this message:
Basic Authentcation returns:
If it's true about what I found out that the only chance is to use a customer connector for that, this would be really bad because I don't have access to AAD in the organization and deploying a custom connector would be a hell to go through security reviews. I just want to get something I can see on the portal in Power BI! Nothing fancy! Funny enough it works with the Graph API, so I can find out AAD users and groups...
Thanks,
Thomas