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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Export report to pbix file - Power BI Rest API

Hi,

 

I am trying to export a report in .pbix format using the power bi rest api export endpoint(https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exportreportingroup). But, after downloading the file I am unable to open the file and receiving an error stating it is corrupt. 

 

I have NodeJS Express API end point and here is the code

 

 exportReport: function ( groupIdreportIdaccessToken) {
        var deferred = QRef.defer();
        const url = config.apiRoot + 'groups/' + groupId + '/reports/' + reportId + '/Export';
        const headers = {
            'Authorization': 'Bearer ' + accessToken
        };
        request.get({ url: url,  headers: headers}, function (errresponse) {
            if(response.statusCode === 200){                
                deferred.resolve(response.body);
            }else{                
                if (err) {
                    deferred.reject(err);
                } else if (parsedBody.error) {
                    deferred.reject(parsedBody.error.message);
                } else {
                    // If successful, return the access token.
                    deferred.resolve(response.body);
                }
            }
            
        });
        return deferred.promise;
    }
 
The frontned is as RectJS application and here is the frontend code.
 
  reqBody.tenantId = reportData.tenantId;
        reqBody.workspaceId = reportData.workspaceId;
        reqBody.reportId = reportData.reportId;
        this.props.exportReport(reqBody).then(() =>{
            console.log(self.props.exportReportObj);
            var blobObj = new File([self.props.exportReportObj.exportReportData], dd.name".pbix" );
            FileSaver.saveAs(blobObj);
        })
 
Can you please help me on this?
1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

It is suggested you that you could create a support ticket for further help.

https://powerbi.microsoft.com/en-us/support/ 

Support_Ticket.gif

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.