Forum Discussion
Enhanced refresh with the Power BI REST API using Python - need help
- 10 months ago
Hi satishorre20,
in my experienve, if the refresh shows “via API” it usually means the request didn’t include the enhanced options in the JSON body, or the dataset isn’t on Premium/PPU/Fabric. In your sample you used params=payload (query string) instead of json=payload (request body), so the service probably treated it like a standard refresh.
- Make sure the workspace is on Premium/PPU or Fabric. Shared/Pro won’t run enhanced refresh. Datasets - Refresh Dataset
- Send your POST with a JSON body that includes at least one enhanced property like objects, commitMode, maxParallelism, or retryCount. Enhanced refresh with the Power BI REST API
- Try this minimal Python example (note the json=):
import requests url = f"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes" headers = { "Authorization": f"Bearer {result['access_token']}", "Content-Type": "application/json" } payload = { "type": "Full", "commitMode": "transactional", "maxParallelism": 2, "retryCount": 2, "objects": [ { "table": "DateDim" } ] } r = requests.post(url, headers=headers, json=payload) # <-- use json, not params print(r.status_code, r.text)
Reference examples and parameters here: Enhanced refresh- Confirm it shows “Via enhanced API” in the refresh history (or pull it programmatically). Get Refresh History In Group
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
Taylor Amy.
Hi satishorre20,
in my experienve, if the refresh shows “via API” it usually means the request didn’t include the enhanced options in the JSON body, or the dataset isn’t on Premium/PPU/Fabric. In your sample you used params=payload (query string) instead of json=payload (request body), so the service probably treated it like a standard refresh.
- Make sure the workspace is on Premium/PPU or Fabric. Shared/Pro won’t run enhanced refresh. Datasets - Refresh Dataset
- Send your POST with a JSON body that includes at least one enhanced property like objects, commitMode, maxParallelism, or retryCount. Enhanced refresh with the Power BI REST API
- Try this minimal Python example (note the json=):
import requests
url = f"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes"
headers = {
"Authorization": f"Bearer {result['access_token']}",
"Content-Type": "application/json"
}
payload = {
"type": "Full",
"commitMode": "transactional",
"maxParallelism": 2,
"retryCount": 2,
"objects": [ { "table": "DateDim" } ]
}
r = requests.post(url, headers=headers, json=payload) # <-- use json, not params
print(r.status_code, r.text)
Reference examples and parameters here: Enhanced refresh
- Confirm it shows “Via enhanced API” in the refresh history (or pull it programmatically). Get Refresh History In Group
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
Taylor Amy.
- satishorre2010 months agoHelper II
Thank you tayloramy it worked