Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I want to create an app which would refresh my dataset when needed by using Power BI REST API post method https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes.
When I send POST request I get back response code "unauthorized". Can't figure out where should be a problem. I have all grants permisions for my app in Azure AD. I'm following this tutorial to get access token https://docs.microsoft.com/en-us/power-bi/developer/automation/walkthrough-push-data-get-token. For request I add header with token, body with "notifyOption" and path with my datasetId. Do I miss some parameters or I am using a wrong access token?
My code sample
HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
var requestBody = new JObject();
requestBody["notifyOption"] = "";
var response = await httpClient.PostAsync(
"https://api.powerbi.com/v1.0/myorg/datasets/****datasetid***/refreshes",
new StringContent(requestBody.ToString(), Encoding.UTF8, "application/json"));
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |