Forum Discussion
Power BI API : GET Refresh works, but POST does not
- 2 years ago
I was trying to save you time but it seems like you insist on using Postman. So please verify this
Then verify that you added the App registration to a security group and at the tenant level
You should also know that a new token is generated every hour and you can only use POST https://api.powerbi.com/v1.0/myorg/datasets/xxxxx/refreshes up to 8 times a day for a shared workspace capacity, just like you schedule a refresh in the service.
So if you are planning on using retool.com then you know what to expect.
However I would recommend that you use Power Automate to create a button in your reports for an unlimitted on-demand refreshes.
- 2 years ago
Hi NicolasLJ
Did you the App Registration ID to the workspace where the dataset is located?
Did allow the App to use API in the tenant le evel?
Note : I use pro licence, I don't have a premium capacity.
I added the App and the group assigned to the app into the workspace as admin.
A is the security group assigned to the service principal and P is the Service principal.
I assigned Dataset.ReadWrite.All role in Azure and Granted by admin (Delegated)
My POST API setup :
And the answer :
- aj19732 years agoCommunity Champion
Hi NicolasLJ
The App registration doesn't need Bearer tokens to connect to the service. You need to use your App Regsitration in a local machine and Powershell to execute the script.
- NicolasLJ2 years agoFrequent Visitor
I will provide more context :
My objective is to add a button to refresh on demand a dataset in a low code application build with retool.com
My setup :
- An App registered in AD (Service principal) with all permissions required and granted by admin
- My app is admin in my PBI workspace
- My Retool App will authenticate with the app id and secret through Oauth2 authentification flow
- Before coding the API orchestration in retool I try to test the all flow with Postman to ensure everything is well configured in Azure and PBI.
I succesfully :
- get the token
- get historical refresh info from a GET request to https://api.powerbi.com/v1.0/myorg/datasets/xxxxx/refreshes
(I replaced dataset id with xxxxx in this message for confidentiallity)
But when I POST to the same url with same auth token, I got ta response with this body in Postman :
{"error": {"code": "ItemNotFound","message": "Dataset xxxxx (I replaced by dataset id in this message for confidentiallity) is not found! please verify datasetId is correct and user have sufficient permissions."}}- aj19732 years agoCommunity Champion
I was trying to save you time but it seems like you insist on using Postman. So please verify this
Then verify that you added the App registration to a security group and at the tenant level
You should also know that a new token is generated every hour and you can only use POST https://api.powerbi.com/v1.0/myorg/datasets/xxxxx/refreshes up to 8 times a day for a shared workspace capacity, just like you schedule a refresh in the service.
So if you are planning on using retool.com then you know what to expect.
However I would recommend that you use Power Automate to create a button in your reports for an unlimitted on-demand refreshes.