Forum Discussion
Anonymous
6 years agoNot applicable
PBIRS Rest API Error while getting DataSource by PowerBI Report ID using Powershell
Hi Everyone,
I am trying to get DataSource Details associated with Power BI Report(on PBIRS) using Rest API (and Powershell)
I referred to API documentation(https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/), the syntax I am using is as below,
(Powershell) Syntax used:
$ReportUri = "http://pbirsxxx.xxxxxxx.local/reports/api/v2.0/PowerBIReports(xxxxxxxx-3343-4c90-b0d0-xxxxxxxxxxxx)/Datasources"
$pbiReports = Invoke-WebRequest -Uri $ReportUri -Method Get -UseDefaultCredentials
Output:
Invoke-WebRequest : { "error":{ "code":"0","message":"" } }
At line:17 char:15
+ ... biReports = Invoke-WebRequest -Uri $pbiReportsURI -Method Get -UseDef ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
At line:17 char:15
+ ... biReports = Invoke-WebRequest -Uri $pbiReportsURI -Method Get -UseDef ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Please help.
Thanks
No Replies