I want to POST import a json file or json data into power bi service using rest api

PersistentDEV_svc 5 Reputation points
2023-02-15T11:03:50.36+00:00

I am able to do POST import .pbix files into my workspace by appending my file as form-data and using the below endpoint
POST https://api.powerbi.com/v1.0/myorg/imports?datasetDisplayName={datasetDisplayName}
But, when I tried to do POST import .json using the same method as mentioned above, I got the below error

{
    "error": {
        "code": "InvalidRequest",
        "message": "Invalid dataflow structure. Exception details: <pi>Invalid model version: </pi>"
    }
}

Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
313 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,999 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 17,875 Reputation points
    2023-04-28T04:48:13.9966667+00:00

    The error message you received suggests that the structure of the JSON file you are trying to import as a dataflow may be invalid or not compatible with the version of Power BI that you are using.

    Here are a few steps you can try to resolve the issue:

    Check the structure of the JSON file: Make sure that the JSON file you are trying to import is in the correct format and contains all the required fields. You can compare it with a working JSON file to ensure that the structure is correct.

    Check the version of Power BI: Make sure that the version of Power BI you are using supports the JSON file format you are trying to import. You can check the version of Power BI by going to "Help" > "About Power BI Desktop".

    1. Try importing the JSON file using the Power BI Desktop: Try importing the JSON file using the Power BI Desktop application to see if you get any error messages. This can help you identify any issues with the file itself.
    0 comments No comments