Forum Discussion

kanth999's avatar
kanth999
Helper I
4 years ago
Solved

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-PowerBIRes...
  • Anonymous's avatar
    Anonymous
    4 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 $Body

     

    Regards,

    Xiaoxin Sheng