Forum Discussion
Power BI Dataset refresh through REST Api using Python
Hi. What's not working? I have just tried pip install and it's modules and are working. It's simplePbi with a P there. There is a typo there.
Regards
Yes. I I was able to install the package. Let me explore now
- capradeep843 years agoRegular Visitor
I have followed all the steps shown in the simplpbi documentation and getting below error
HTTP Error: 401 Client Error: Unauthorized for url: https://api.powerbi.com/v1.0/myorg/admin/datasets
Text:
HTTP Error: 401 Client Error: Unauthorized for url: https://api.powerbi.com/v1.0/myorg/admin/groups/381c81c8-fd15-41bc-a0f0-af83bc716452/datasets
Text:
- ibarrau3 years agoSuper User
Are you a Power Bi Admin? You are using admin/groups/{group}/datasets. That will require a PowerBi Admin role for the user logged or the following configuration for service principal:
https://learn.microsoft.com/en-us/power-bi/enterprise/read-only-apis-service-principal-authenticationYour first example was for datasets not for admin. For refreshing you don't need admin. You just need to be added at the workspace storing the dataset (the account or the service principal app). You can try get_datasets_in_group from datasets category to read them before using the refresh.
I hope that helps,
- capradeep843 years agoRegular Visitor
Is it possible for you to connect on Teams meeting. My email ID is [email protected]
You are really very kind. Thank you so much