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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
frolesti
Frequent Visitor

PowerBI API - Export To File call failing miserably

Hi there!


I am using the PowerBI API from an external application, trying to export PBI reports from it but keep having the same vague error message: 
{
"message": "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Export report was called with a bad request\"}}",
"error": true,
"errorCode": "",
"logout": false,
"data": []
}

 

I have seen some messages in here with similar issues but none has worked for my case. I am not really sure where to watch since I couldn't find what should be the proper configuration to be sent to the API, but when sending the reportConfig variable as empty, I can export the file (which makes no sense to me). This is my current reportconfig.identities object:

 

 

 

 

"identities": [
    {
        "customData": null,
        "datasets": ["cacd616a-9d18-4b8d-a072-12888be88566"],
        "identityBlob": null,
        "reports": null,
        "roles": [],
        "username": "[email protected]"
    }
]

 

 

 

 

 

I have seen in previous interventions that some versions needed to delete the reports property in order to adapt to the latest changes of the API but it did not solve my issue.

 

Does anybody have dealt with something similar or has any idea on how to deal with this?

4 REPLIES 4
frolesti
Frequent Visitor

Yes, RLS is activated in the dataset. It has worked until recently, I had some error before related to the roles, I have added a conditional with an empty array for strings and the roles error disappeared, but now I have this one. I don't know, it seems like something has happened since the code hasn't been modified for a long time.

@frolesti I think that an effective identity with username and without roles isn't valid in most scenarios.

Why aren't you passing the required role?

Hi

 

We are not passing roles since we are dealing with the reports fom an external application and the roles are manually added from there, so most of the roles come back as empty.

I don't know if there is some kind of standard role such as "reader" or something like that that can provide an existing role and will prevent the error from happening.

I am not profficient in PowerBI so I did not know that this was so conflictive. I'd like to know as well if you recommend to pass this role from powerBI or should I pass it in the backend of my app to act as a safenet.

Thank you in advance!

AmosHersch
Microsoft Employee
Microsoft Employee

Hi @frolesti ,

 

Seems that you are trying to provide an effective identity for your dataset.

Does your dataset have RLS applied? If not then I think this is the reason for the error. The only reason for providing an effective identity for a dataset is for applying RLS filtering during the export rendering.

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.