Forum Discussion
REST API get dataset data - Datasets - Execute Queries
Hi All,
I need to get data from a dataset online.
How can I use REST API to show data online?
Thanks,
Alex
Well, you can allow Service Principals to use Power Bi Rest API on your PowerBI Admin Portal tenant settings. Then register the app, get the secret, add permissions, add the Service Principal to the workspace. After that you can share a Service Principal to external users. They should be able to use the Rest API and excecute queries
I hope that helps,
Thanks ibarrau
6 Replies
- ibarrauSuper User
Hi. How do you want to connect? I mean, you can open Power Bi Desktop and get data from PowerBi Datasets to build new reports from a current dataset. The admin must have the connection across datasets turned on.
If you just want to use a language code to get specific thing from a dataset, you can use the rest api. It would be this request:
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries-in-groupIf you find hard to use the API you can use libraries depending on the language. For example you can import SimplePBI for python or use cmdlets for power bi on PowerShell.
Be sure to read the Considerations and Limitations on the link above.
I hope that helps,
- ibarrauSuper User
Hi. There might be many videos with PowerShell beacuse it's kind of the language Microsoft users for scripting. But I'm sure that if you google X language + power bi rest api you might find something. You need an understanding of APIs in a language first.
You can also check the documentation: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/get-datasets-in-group
Custom libraries built by people also have some details on how to use them. SimplePBI for example has definitions on the repo:
https://github.com/ladataweb/SimplePBII hope something like this helps,