Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

0

Power BI REST API ExportToFileInGroup stopped working

Hello,

 

I would like to submit an issue i'm encountering with the Power BI REST API.

We used to succesfully call "ExportToFileInGroup" route on our web app, and then it stopped working without changing code or updating the app core.

So i tested this route online with the "try it" function on documentation, and didn't manage to make it work on the first place with the usual post body:

 

 

 

{
  "format":"PDF",
  "powerBIReportConfiguration": {
    "identities": [
      {
        "username":"xxx",
        "roles":["xxx"],
        "reports":["xxx"],
        "datasets":["xxx"]
      }
    ]
  }
}

 

 

 

It returns a 400 error:

 

 

 

{
  "error": {
    "code": "InvalidRequest"
    "message": "Export report was called with a bad request"
  }
}

 

 

 

First weird thing, I tried modifying "powerBIReportConfiguration" property to the name of the class it's accepting, "PowerBIReportExportConfiguration".

It worked :

Screenshot 2023-01-06 at 16-06-49 Reports - Export To File In Group - REST API (Power BI Power BI REST APIs).png

 

So then i tried the same EXACT SAME request in the webapp, but i'm getting a new error, even if it worked properly on "try it":

 

 

 

{
  "error": {
    "code": "InvalidRequest"
    "message": "Export report requires effective identity to be provided for the report's dataset"
  }
}

 

 

 

The dataset does require an identity, and it used to work. I can't tell exactly when it stopped working (some months ago).

I must say i'm hitting a deadend here, hope someone can lead me to the solution.

 

Thanks

Status: Delivered
Comments
Anonymous
Not applicable

Hi @g2a-consulting 

The identity you used is effective ?

 

Best Regards,
Community Support Team _ Ailsa Tao

g2a-consulting
Regular Visitor

Hi @Anonymous 

Thanks for your response.

 

The identity is effective inside the dataset, I can use it for row-level security, and it can be used for showing a report with power bi embedded without errors.

g2a-consulting
Regular Visitor

Hi,

Finally found what was has changed on API's side, reported it in my call.

"reports" property inside "powerBiReportConfiguration" could be used even if the report wasn't a paginated report.
Now it throws an error if used on a not paginated report.

Removing it from the configuration made the call work again:

 

{
  "format":"PDF",
  "powerBIReportConfiguration": {
    "identities": [
      {
        "username":"xxx",
        "roles":["xxx"], 
        // "reports":["xxx"],
        "datasets":["xxx"]
      }
    ]
  }
}

 

 

 

Anonymous
Not applicable

Hi @g2a-consulting 

I am so glad to hear that you have fixed your issue . I will change the status to "Delivered" .

 

Best Regards,
Community Support Team _ Ailsa Tao