cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rbroida Frequent Visitor
Frequent Visitor

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:

 

 

4 REPLIES 4
jbrandt Frequent Visitor
Frequent Visitor

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

Looking for this info as well, did you ever find any examples?
Highlighted
Dan2 Regular Visitor
Regular Visitor

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

Would like an answer to this as well

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

I have the same problem with this api.

I try to call the api from Sdk V2 "PostImportWithFileAsyncInGroup" and also create a post to this url "https://api.powerbi.com/v1.0/myorg/groups/{groupID}/imports?datasetDisplayName={name}": the response is always BadRequest.

 

How can I fix?

 

Thanks

 

atsats Frequent Visitor
Frequent Visitor

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

I'm also getting the Bad Request response - pretty amazing that more than a year after the question was first asked the question is still unanswered and the documentation is still woefully inadequate. 

 

What a waste of time for developers to reverse-engineer APIs that should've been documented in teh first place.

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Top Kudoed Authors
Users Online
Currently online: 332 members 3,407 guests
Please welcome our newest community members: