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
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.
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 :
- 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.