1

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?

A.D
  • 47
  • 1
  • 1
  • 11

1 Answers1

1

Add this into the body of step 1:


{
    format: "PDF",
"paginatedReportConfiguration": {
        "parameterValues": [
            {
                  "name":"nameOfYourParameter",
                  "value":"valueOfYourParameter"
            }
        ]
    }
}
  • Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, **can you [edit] your answer to include an explanation of what you're doing** and why you believe it is the best approach? – Jeremy Caney Nov 19 '22 at 00:28