power bi report server api
2 TopicsPBIRS This may be due to a connection failure, timeout or low disk condition within the database
I am able to get all the reports from the power bi report server using the https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/Reports/GetReports endpoint, i am able to download the report i want via the https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/CatalogItems/GetCatalogItem endpoint. But when i try to put the report back via https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/CatalogItems/UpdateCatalogItem endpoint i am getting the following error "An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database." the powershell script i am using with the update endpoint looks like so:- $bytes = [System.IO.File]::ReadAllBytes($uploadItemPath); $payload = @{ "@odata.type" = "#Model.Report"; "Content" = [System.Convert]::ToBase64String($bytes); "ContentType"=""; "Name" = 'report name'; "Description" = ""; "Hidden"="False"; "Path" = '/path/on/the/server/report name'; } | ConvertTo-Json; $response=Invoke-WebRequest -Uri $catalogItemsUri -Method Put -Body $payload -ContentType "application/json" -UseDefaultCredentials -UseBasicParsing | Out-Null; $response=$response.Content | ConvertFrom-Json; where $uploadItemPath is the path on my local machine where the rdl file is located how should i go about resolving this issue491Views0likes0CommentsChange Data Source Credentials with api Power BI Report Server
Hi, I am trying to change the credentials of a datasource with the power bi server api but I get the error "(400) Bad Request". When I make the call to get the details from the datasource, this is the only thing that is returned: { Id=XXXXXXXXXXXXXXXXXX Name=; Description=; Path=; Type=DataSource; Hidden=False; Size=0; ModifiedBy="XXXXXX"; ModifiedDate=2022-07-13T12:17:24.08+02:00; CreatedBy="XXXXXX"; CreatedDate=2022-07-13T12:16:38.52+02:00; ParentFolderId=; IsFavorite=False; ContentType=; Content=; IsEnabled=True; ConnectionString=dwh_pro; DataSourceType=; IsOriginalConnectionStringExpressionBased=False; IsConnectionStringOverridden=False; CredentialRetrieval=prompt; IsReference=False; DataSourceSubType=DataModel; Roles=System.Object[]; CredentialsByUser=; CredentialsInServer=; DataModelDataSource= } About datasource: it is a connection to Oracle with Basic Autehntication (no windows like the others examples): Username and Password. I detail the script to see if you can help me: $payload = @" { "Id": "XXXXXXXXXXXXXXXXXX", "Name": "", "Description": "", "Path": "", "Type": "DataSource", "Hidden": False, "Size": 0, "ModifiedBy": "XXXXXXXX", "ModifiedDate": "2022-07-13T12:17:24.08+02:00", "CreatedBy": "XXXXXXXX, "CreatedDate": "2022-07-13T12:16:38.52+02:00", "ParentFolderId": "XXXXXXXXXX", "ContentType": "", "Content": "", "IsFavorite": False, "IsEnabled": true, "ConnectionString": "dwh_pro", "DataModelDataSource": { "AuthType": "Unknown", "SupportedAuthTypes": [ "" ], "Kind": "Oracle", "ModelConnectionName": "", "Secret": "XXXXX", "Type": "Import", "Username": "XXXXXX" }, "DataSourceSubType": "DataModel", "DataSourceType": "Oracle", "IsOriginalConnectionStringExpressionBased": False, "IsConnectionStringOverridden": true, "CredentialRetrieval": "store", "CredentialsByUser": { "DisplayText": "", "UseAsWindowsCredentials": false }, "CredentialsInServer": { "UserName": "XXXXX", "Password": "XXXXX", "UseAsWindowsCredentials": false, "ImpersonateAuthenticatedUser": false }, "IsReference": false } } "@ $restApiUri = "https://XXXXX" + "/api/v2.0/PowerBIReports(id)/DataSources" $user = "XXXXX" $pass= "XXXXXX" $proxy = "http://XXXXXX" $proxycred = "XXXXX" $secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force $credential = New-Object System.Management.Automation.PSCredential($user, $secpasswd) $inicio = (get-date).ToString('f') Invoke-RestMethod -Uri $restApiUri -Method 'Patch' -Body $payload -ContentType "application/json" -Credential $credential -Proxy $proxy -ProxyCredential $proxycred -UseBasicParsing -Verbose Thanks you very muchSolved1.7KViews0likes3Comments