Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kanth999
Helper I
Helper I

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 

1 ACCEPTED SOLUTION
Anonymous
Not 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

Capture.PNG

2.png

Test script:

 

$Body ="{'notifyOption'='NoNotification'}"
Invoke-PowerBIRestMethod -Url 'datasets/62b66b9e-a296-439f-8fb2-95b526196c13/refreshes' -Method Post -Body $Body

 

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not 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

Capture.PNG

2.png

Test script:

 

$Body ="{'notifyOption'='NoNotification'}"
Invoke-PowerBIRestMethod -Url 'datasets/62b66b9e-a296-439f-8fb2-95b526196c13/refreshes' -Method Post -Body $Body

 

Regards,

Xiaoxin Sheng

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 ?

Anonymous
Not 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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.