rest api swagger
3 TopicsUpdating parameter in a published report
I am on Report Server version 1.12.7936.39665 and trying to update one parameter in a simple published report, with PBRS REST API (PBIRS | 2.0 | microsoft-rs | SwaggerHub) but despite the successful update, the parameter keeps its original value. Here is the simple steps to recreate the issue: 1. Publishing a simple single query report to path /MyReport, with paramater called Databasename. 2. Double checking the current paramater value with a simple GET call: http://MyReportServer/Reports/api/v2.0/PowerBIReports(path='/MyReport')/DataModelParameters gives me back the expected original parameter value from the report which is: "Name": "Databasename", "Value": "MyOriginalDb" 3. Now updating the parameter for the report with a POST message: http://MyReportServer/Reports/api/v2.0/PowerBIReports(path='/MyReport')/DataModelParameters Message body: [ { "Name": "Databasename", "Value": "MyNewDb" } ] Works as expected, i have a successful POST pesponse. Also the PowerBI report server log shows no error on my POST message. So the report now has the Databasename parameter with MyNewDb value. 4. Issuing a GET for the report, it gives back the expected new value which is "MyNewDb:" http://MyReportServer/Reports/api/v2.0/PowerBIReports(path='/MyReport')/DataModelParameters Response: { "@odata.context": "http://MyReportServer/Reports/api/v2.0/$metadata#Collection(Model.DataModelParameter)", "value": [ { "Name": "Databasename", "Value": "MyNewDb" } ] } Indeed, the parameter update went fine in the published report. 5. Now comes the problem: Opening the report directly from the report server (even with Power BI Desktop app) still uses and has the old paramater value "MyOriginalDb" instead of "MyNewDb" (even after refresh) Tried with PBRS PowerShell tools as well: GitHub - microsoft/ReportingServicesTools: Reporting Services Powershell Tools Same issue. Is it a bug? Seems like the report is cached somehow at the web portal side and not updating with the backend? What could be the workaround here?Solved3.4KViews0likes5CommentsUpload pbix file to Report Server using C# HttpClient
I am looking for an example for ages how to upload a PBIX file to Power BI Report Server. With the help of Swagger PBIRS | 2.0 | microsoft-rs | SwaggerHub I have managed to upload a file from Power Shell, but can't figure out how would it look like in C# using the HttpClient library. Does anybody have an example? (The HttpClient is mandatory for me to use)Solved1.7KViews0likes2CommentsProblem setting CacheOptions and expiration schedule via REST API (V2.0) in C#/Swagger API
I use the downloaded and compiled Swagger API for Power BI Resort Server and I'm able to list content (e.g. Reports) (GET request) or upload content (e.g. PBIReport or paginated report) (POST request) using C#. But I have problems updating items with the REST API (PUT request): For example I need to update the CacheOptions of a (paginated) report. Here are the relevant code fragments: 1.: get the ReportsAPI client object // get the ReportsAPI client object var client = new ReportsApi(apiString); ... do authentication (Forms) and get a report object (I ommited the code ...) ... 2.: get the CacheOptions object of a uploaded paginated report // works - I get the CacheOptions object CacheOptions co = client.GetReportCacheOptions(report.Id.ToString()); 3.: immediately try to update the report by setting the CacheOptions object (unmodified in this sample) on the report // does not work - I get an exception inside of the Swagger API client.SetReportCacheOptions(report.Id.ToString(), co); // just a test ... On step 3. I have the problem that an exception within Swagger ReportsAPI is thrown: The property 'ScheduleId' does not exist on type 'Model.ScheduleReference'. Make sure to only use property names that are defined by the type. Trying to redo the steps with the help of Postman gives me a error 500 (internal server error) when trying to put a CacheOption JSON in the raw body (URL="https://myserver/reports/api/v2.0/Reports(690f6c2a-8995-4d29-bbd4-a4b2cc839bcb)/CacheOptions") I have this kind of problem while using this coding approach not only for CacheOptions but for all other PUT requests I tested. Maybe someone can help me out with this? Thanks, LarsSolved2.1KViews0likes5Comments