Reply
Frequent Visitor
Posts: 4
Registered: ‎07-16-2018

Imports.Postimportingroup() in .NET SDK returns 400 Bad Request

Using the .NET SDK, I want to programmatically import a dataset, which is defined in a .PBIX file stored in OneDrive for Business, into an app workspace. The method PowerBIClient.Imports.PostImportInGroupAsync() is supposed to accomplish this. However, I get inscrutable 400 Bad Request errors whenever I call it.

 

Microsoft doesn't seem to have any online documentation of this .NET SDK method. (There doesn't seem to be complete reference documentation to the .NET SDK, period.) There is documentation for the underlying REST API here:

 

https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimportingroup#importconflicthandlermo...

 

What I don't see is any explanation of what the "ImportInfo" (sent as message body in the REST API) should contain. It has three properties, all strings: FilePath, FileUrl, and ConnectionType. I believe ConnectionType is supposed to be set to "import", but I don't know what the proper for is for FilePath or FileUrl, and I have found no examples.

 

Could someone please explain, preferably with an example, how to call this SDK method successrfully?

Code in C# is essentially this:

 

 

Frequent Visitor
Posts: 21
Registered: ‎12-15-2016

Re: Imports.Postimportingroup() in .NET SDK returns 400 Bad Request

Looking for this info as well, did you ever find any examples?