Power BI API - get dataset by ID












1















One of the Power BI APIs is to get dataset by ID. Can someone shed light on the command syntax to get a table of a dataset from a workspace please? Thank you.



GET https://api.powerbi.com/groups/{workspace ID}/datasets/{dataset ID}/{TableName} ?










share|improve this question



























    1















    One of the Power BI APIs is to get dataset by ID. Can someone shed light on the command syntax to get a table of a dataset from a workspace please? Thank you.



    GET https://api.powerbi.com/groups/{workspace ID}/datasets/{dataset ID}/{TableName} ?










    share|improve this question

























      1












      1








      1








      One of the Power BI APIs is to get dataset by ID. Can someone shed light on the command syntax to get a table of a dataset from a workspace please? Thank you.



      GET https://api.powerbi.com/groups/{workspace ID}/datasets/{dataset ID}/{TableName} ?










      share|improve this question














      One of the Power BI APIs is to get dataset by ID. Can someone shed light on the command syntax to get a table of a dataset from a workspace please? Thank you.



      GET https://api.powerbi.com/groups/{workspace ID}/datasets/{dataset ID}/{TableName} ?







      powerbi






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 14:56









      MochabitsMochabits

      787




      787
























          1 Answer
          1






          active

          oldest

          votes


















          1














          If you are looking for a way to get table's schema (list of columns), currently the API does not provide a way to do this. Probably the presumption is that this dataset is created using the API, so you should know what you created. If you want to get a list of tables in a dataset, you can use https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables like this:



              private void GetDatasetById(string accessToken, string groupId, string datasetId)
          {
          string powerBIDatasetsApiUrl = $"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables";

          var request = WebRequest.Create(powerBIDatasetsApiUrl) as HttpWebRequest;
          request.KeepAlive = true;
          request.Method = "GET";
          request.ContentLength = 0;
          request.ContentType = "application/json";
          request.Headers.Add("Authorization", $"Bearer {accessToken}");
          using (HttpWebResponse httpResponse = request.GetResponse() as System.Net.HttpWebResponse)
          {
          using (StreamReader reader = new System.IO.StreamReader(httpResponse.GetResponseStream()))
          {
          MessageBox.Show(reader.ReadToEnd());
          }
          }
          }





          share|improve this answer


























          • I want to call the API using Javascript like jquery in a webpage and get the data of a dataset, not just the column names. Thank you for the quick response.

            – Mochabits
            Nov 14 '18 at 20:31






          • 1





            I don't think you can do this. Possibly you can get the data source and read the data directly from there. Or embed a tile with a table in your site.

            – Andrey Nikolov
            Nov 14 '18 at 20:46











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303042%2fpower-bi-api-get-dataset-by-id%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          If you are looking for a way to get table's schema (list of columns), currently the API does not provide a way to do this. Probably the presumption is that this dataset is created using the API, so you should know what you created. If you want to get a list of tables in a dataset, you can use https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables like this:



              private void GetDatasetById(string accessToken, string groupId, string datasetId)
          {
          string powerBIDatasetsApiUrl = $"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables";

          var request = WebRequest.Create(powerBIDatasetsApiUrl) as HttpWebRequest;
          request.KeepAlive = true;
          request.Method = "GET";
          request.ContentLength = 0;
          request.ContentType = "application/json";
          request.Headers.Add("Authorization", $"Bearer {accessToken}");
          using (HttpWebResponse httpResponse = request.GetResponse() as System.Net.HttpWebResponse)
          {
          using (StreamReader reader = new System.IO.StreamReader(httpResponse.GetResponseStream()))
          {
          MessageBox.Show(reader.ReadToEnd());
          }
          }
          }





          share|improve this answer


























          • I want to call the API using Javascript like jquery in a webpage and get the data of a dataset, not just the column names. Thank you for the quick response.

            – Mochabits
            Nov 14 '18 at 20:31






          • 1





            I don't think you can do this. Possibly you can get the data source and read the data directly from there. Or embed a tile with a table in your site.

            – Andrey Nikolov
            Nov 14 '18 at 20:46
















          1














          If you are looking for a way to get table's schema (list of columns), currently the API does not provide a way to do this. Probably the presumption is that this dataset is created using the API, so you should know what you created. If you want to get a list of tables in a dataset, you can use https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables like this:



              private void GetDatasetById(string accessToken, string groupId, string datasetId)
          {
          string powerBIDatasetsApiUrl = $"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables";

          var request = WebRequest.Create(powerBIDatasetsApiUrl) as HttpWebRequest;
          request.KeepAlive = true;
          request.Method = "GET";
          request.ContentLength = 0;
          request.ContentType = "application/json";
          request.Headers.Add("Authorization", $"Bearer {accessToken}");
          using (HttpWebResponse httpResponse = request.GetResponse() as System.Net.HttpWebResponse)
          {
          using (StreamReader reader = new System.IO.StreamReader(httpResponse.GetResponseStream()))
          {
          MessageBox.Show(reader.ReadToEnd());
          }
          }
          }





          share|improve this answer


























          • I want to call the API using Javascript like jquery in a webpage and get the data of a dataset, not just the column names. Thank you for the quick response.

            – Mochabits
            Nov 14 '18 at 20:31






          • 1





            I don't think you can do this. Possibly you can get the data source and read the data directly from there. Or embed a tile with a table in your site.

            – Andrey Nikolov
            Nov 14 '18 at 20:46














          1












          1








          1







          If you are looking for a way to get table's schema (list of columns), currently the API does not provide a way to do this. Probably the presumption is that this dataset is created using the API, so you should know what you created. If you want to get a list of tables in a dataset, you can use https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables like this:



              private void GetDatasetById(string accessToken, string groupId, string datasetId)
          {
          string powerBIDatasetsApiUrl = $"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables";

          var request = WebRequest.Create(powerBIDatasetsApiUrl) as HttpWebRequest;
          request.KeepAlive = true;
          request.Method = "GET";
          request.ContentLength = 0;
          request.ContentType = "application/json";
          request.Headers.Add("Authorization", $"Bearer {accessToken}");
          using (HttpWebResponse httpResponse = request.GetResponse() as System.Net.HttpWebResponse)
          {
          using (StreamReader reader = new System.IO.StreamReader(httpResponse.GetResponseStream()))
          {
          MessageBox.Show(reader.ReadToEnd());
          }
          }
          }





          share|improve this answer















          If you are looking for a way to get table's schema (list of columns), currently the API does not provide a way to do this. Probably the presumption is that this dataset is created using the API, so you should know what you created. If you want to get a list of tables in a dataset, you can use https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables like this:



              private void GetDatasetById(string accessToken, string groupId, string datasetId)
          {
          string powerBIDatasetsApiUrl = $"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/tables";

          var request = WebRequest.Create(powerBIDatasetsApiUrl) as HttpWebRequest;
          request.KeepAlive = true;
          request.Method = "GET";
          request.ContentLength = 0;
          request.ContentType = "application/json";
          request.Headers.Add("Authorization", $"Bearer {accessToken}");
          using (HttpWebResponse httpResponse = request.GetResponse() as System.Net.HttpWebResponse)
          {
          using (StreamReader reader = new System.IO.StreamReader(httpResponse.GetResponseStream()))
          {
          MessageBox.Show(reader.ReadToEnd());
          }
          }
          }






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 14 '18 at 19:31

























          answered Nov 14 '18 at 18:14









          Andrey NikolovAndrey Nikolov

          4,1433821




          4,1433821













          • I want to call the API using Javascript like jquery in a webpage and get the data of a dataset, not just the column names. Thank you for the quick response.

            – Mochabits
            Nov 14 '18 at 20:31






          • 1





            I don't think you can do this. Possibly you can get the data source and read the data directly from there. Or embed a tile with a table in your site.

            – Andrey Nikolov
            Nov 14 '18 at 20:46



















          • I want to call the API using Javascript like jquery in a webpage and get the data of a dataset, not just the column names. Thank you for the quick response.

            – Mochabits
            Nov 14 '18 at 20:31






          • 1





            I don't think you can do this. Possibly you can get the data source and read the data directly from there. Or embed a tile with a table in your site.

            – Andrey Nikolov
            Nov 14 '18 at 20:46

















          I want to call the API using Javascript like jquery in a webpage and get the data of a dataset, not just the column names. Thank you for the quick response.

          – Mochabits
          Nov 14 '18 at 20:31





          I want to call the API using Javascript like jquery in a webpage and get the data of a dataset, not just the column names. Thank you for the quick response.

          – Mochabits
          Nov 14 '18 at 20:31




          1




          1





          I don't think you can do this. Possibly you can get the data source and read the data directly from there. Or embed a tile with a table in your site.

          – Andrey Nikolov
          Nov 14 '18 at 20:46





          I don't think you can do this. Possibly you can get the data source and read the data directly from there. Or embed a tile with a table in your site.

          – Andrey Nikolov
          Nov 14 '18 at 20:46




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303042%2fpower-bi-api-get-dataset-by-id%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Florida Star v. B. J. F.

          Error while running script in elastic search , gateway timeout

          Adding quotations to stringified JSON object values