Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi folks,
I am facing issue while uploading a PBIX file from local storage using import API. Code is in nodejs. Please find snipshot below
let options = {
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data',
'authorization': 'Bearer ' + authToken
},
body: fs.createReadStream(filePathOnLocal + 'report.pbix'),
url: `https://api.powerbi.com/v1.0/myorg/groups/${group_id}/imports?datasetDisplayName=report.pbix&nameConflict=CreateOrOverwrite`
};
const result = await axios.request(options)
It is giving me error
I had found same code in other post, but not sure why I am facing this issue.
Also for verify if file is correct or not, I have called PBI API directly from Postman with same file and it successfully upload the file on desired group. Only for code it is failing
Solved! Go to Solution.
Issue fixed, from one of the post I come to know that Content-Lenght is required to append in headers.
Attaching link of that post
'Post in Group' API using Nodejs - Microsoft Fabric Community
Happy sharing
One more observation, with axios only we have to do these changes. Because I have tried with request library(depricated in nodejs) also and it works fine.
Issue fixed, from one of the post I come to know that Content-Lenght is required to append in headers.
Attaching link of that post
'Post in Group' API using Nodejs - Microsoft Fabric Community
Happy sharing
| User | Count |
|---|---|
| 8 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |