powerbipowerbi-rest-api

Download Parametrized Report via Power BI Rest API


I have created a report with Power BI Report Builder and published it on Power BI Service. I have found 3 steps to download report via API

  1. POST Request to start the process https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/ExportTo
  2. GET request to check the status if file is available for download https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/exports/{exportId}
  3. Once file is ready use GET request to download the file https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/exports/{exportId}/file

Now, I have a parametrized report. I am unable to pass parameter in step 1. I have found this link https://learn.microsoft.com/en-us/power-bi/paginated-reports/report-builder-url-pass-parameters

but its not working.

I tried above steps on

  1. https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group?tryIt=true&source=docs#code-try-0

  2. https://learn.microsoft.com/en-us/rest/api/power-bi/reports/get-export-to-file-status-in-group?tryIt=true&source=docs#code-try-0

  3. https://learn.microsoft.com/en-us/rest/api/power-bi/reports/get-file-of-export-to-file-in-group?tryIt=true&source=docs#code-try-0

What is right syntax to pass report parameter in step 1?


Solution

  • Add this into the body of step 1:

    
    {
        format: "PDF",
    "paginatedReportConfiguration": {
            "parameterValues": [
                {
                      "name":"nameOfYourParameter",
                      "value":"valueOfYourParameter"
                }
            ]
        }
    }