Forum Discussion
Upload a JSON file using Power BI API
FelixC I thought json files were only for importing dataflows.
Imports - Post Import - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Is this being set? Hard to see in your screen shots:
- To import a file, specify the content type multipart/form-data in the request headers and encode the file as form data in the request body.
- FelixC4 years agoNew Member
Greg_Deckler
Yes, Content-Type is set to "multipart/form-data", you can click on screenshot to open image.
I'm new with PowerBi and this API so maybe it's not the good way to create dataset.
I just want to create new dataset in Power BI online service from a web server with json or directly from my database. This has to be automatic so I can't use Power BI Desktop.- Greg_Deckler4 years agoCommunity Champion
FelixC Here's what I would try. Create a small, couple MB PBIX file and see if you can post it as a dataset using the API. This should remove any doubt about whether it is something you are doing wrong in postman or it is simply that you are trying to do something that is not supported with a JSON file. I can't find any information about using JSON to create datasets other than maybe Push datasets. This article claims to do what you want to do but doesn't actually use the Power BI REST API, I think the author is confused.
Importing data from JSON files and Power BI Rest APIs into Power BI (sqlshack.com)
- FelixC4 years agoNew Member
@Greg_Deckler
I just tried and it works with a PBIX file so maybe it's not possible with json.
I read this article but the author use an external api to generate data and connect PowerBI desktop on it and that's not what I want.
It's really strange there is no way to add new data from json or database to PowerBI online like in PowerBI desktop.
Maybe I sould create a new ticket for this question.