Forum Discussion
Call any Power BI REST API with PowerShell issue
Hi Team,
I am trying to refresh the PoweBI dataset from PowerBI rest API using Powershell getting below error can you please help me how to fix the issue
using command
Invoke-PowerBIRestMethod -Url "datasets/19b9e00-e8f2-4f81-baae-e2ee907af256/refreshes" -Method Post
getting error
Invoke-PowerBIRestMethod: One or more errors occurred. (Response status code does not indicate success: 404 (Not Found).)
Note: i am running this command on Mac
- Anonymous4 years ago
HI kanth999,
I think you may miss the required part in the request so these requests do not work.
It works well when I test the script with all required parameters: (since the API has no response so I check that in my workspace and you can find the dataset has been updated correctly)
Datasets - Refresh Dataset - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Test script:
$Body ="{'notifyOption'='NoNotification'}" Invoke-PowerBIRestMethod -Url 'datasets/62b66b9e-a296-439f-8fb2-95b526196c13/refreshes' -Method Post -Body $BodyRegards,
Xiaoxin Sheng
3 Replies
- AnonymousNot applicable
HI kanth999,
I think you may miss the required part in the request so these requests do not work.
It works well when I test the script with all required parameters: (since the API has no response so I check that in my workspace and you can find the dataset has been updated correctly)
Datasets - Refresh Dataset - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Test script:
$Body ="{'notifyOption'='NoNotification'}" Invoke-PowerBIRestMethod -Url 'datasets/62b66b9e-a296-439f-8fb2-95b526196c13/refreshes' -Method Post -Body $BodyRegards,
Xiaoxin Sheng
- kanth999Helper I
Can you please let me know, is there are any documents that will run the PowerShell commandlet in Mac os?, Mac OS is suitable to run the PowerShell commands ?
- AnonymousNot applicable
HI kanth999,
If the modules do not require any additional package that your system does not support, you can also run these on the mac os system.
I check the document and found it seems not to include any additional software requirements so I think these scripts may also work on your device. (prerequisites are for PowerShell itself: windows system PowerShell 3.0 and .net 4.7.1, other types of system PowerShell core support and PowerShell core v6)Power BI Cmdlets reference | Microsoft Docs
Regards,
Xiaoxin Sheng