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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.