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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
keshavram-kudwa
New Member

Create a Report using JSON, CSV or Excel File with Power Bi Rest API

I can have my data in three different file formats i.e. JSON, CSV or Excel. I want to create a report using Power Bi Rest API. I tried to use the https://learn.microsoft.com/en-us/rest/api/power-bi/imports/post-import API but I'm getting the following errors:

 

{
    "error": {
        "code": "RequestedFileIsEncryptedOrCorrupted",
        "pbi.error": {
            "code": "RequestedFileIsEncryptedOrCorrupted",
            "parameters": {},
            "details": [],
            "exceptionCulprit": 1
        }
    }
}

 

 I have used OAuth Authentication here. What is the proper way to create a report with raw data using Power Bi Rest API? If there is one, is there a step-by-step guide anywhere.

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @keshavram-kudwa ,

 

This API is used to create new content in My Workspace.

Please check the limitations of this API:

  • Dataflows with service principal aren't supported.
  • Importing a Power BI .pbix file from OneDrive isn't supported.
  • Importing a file that has a protected sensitivity label isn't supported for service principals.

Moreover you need to ensure that the datasetDisplayName property/argument ends with .json/.csv/.xlsx

 

Best Regards,

Jianbo Li

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

Hi @v-jianboli-msft,

 

Thanks for responding, I tried your solution but now I get the following error:

{
    "error": {
        "code": "InvalidRequest",
        "message": "Invalid dataflow structure. Exception details: <pi>Cannot populate JSON array onto type 'Microsoft.Cdsa.ObjectModel.Model'. Path '', line 1, position 1.</pi>"
    }
}

 

Here's a glimpse of my data:

[{"vin":"1VWAH7A38CC981838","make":"GMC","model":"Yukon XL 2500","year":2008},
{"vin":"WAUAF78E28A028588","make":"Pontiac","model":"Bonneville","year":1997},
{"vin":"WA1WYAFE9AD228868","make":"Hummer","model":"H3","year":2008},
{"vin":"WA1CFAFP1EA504218","make":"Oldsmobile","model":"Aurora","year":2003},
{"vin":"WAUFFAFL1CN972498","make":"Nissan","model":"Murano","year":2005}]

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.