I am trying to use the API to query the set of tables associated with this dataset.
This works correctly with the sample dataset and dataset that I created "through the API."
But it does not work with one of my existing datasets that was bound to an SQL data source. I would not think that this is important, because the data is already configured in PowerBI.
It may have a few lines that it does not understand, but the error message is not very informative:
StatusCode: 501, ReasonPhrase: "Not implemented"
public static void PowerBiMain() { token = AccessToken(); var datasetId = GetDatasets().value.GetDataset(datasetName).Id; var tables = GetTables(datasetId); } public static Tables GetTables(string datasetId) { Tables response = null; try { var request = DatasetRequest(String.Format("{0}/{1}/tables", powerBiApiUrl, datasetId), "GET", token); var responseContent = GetResponse(request); var json = new JavaScriptSerializer(); response = (Tables)json.Deserialize(responseContent, typeof(Tables)); } catch (Exception ex) { Console.WriteLine("Data: "+ex.Data); Console.WriteLine("Message: " + ex.Message); Console.WriteLine("Source: " + ex.Source); Console.WriteLine("TargetSite: " + ex.TargetSite); Console.WriteLine("StackTrace: " + ex.StackTrace); }
c # powerbi
Turgut kanceltik
source share