Forum Discussion
Anonymous
7 years agoNot applicable
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.PostImportIn...
andrask
3 years agoNew Member
Having the same issue here. Attaching SDK C# code.
var importUrl = $"https://api.powerbi.com/v1.0/myorg/groups/{targetWorkspaceId}/imports?datasetDisplayName={reportName}&nameConflict=Ignore&skipReport=false&overrideReportLabel=true&overrideModelLabel=true";
var importRequest = new { fileUrl = recievedUploadUrl };
var importResponse = await httpClient.PostAsync(importUrl, new StringContent(JsonConvert.SerializeObject(importRequest), Encoding.UTF8, "application/json"));