<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom REST calls in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Custom-REST-calls/m-p/3557303#M938</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/135"&gt;@gbrueckl&lt;/a&gt;&amp;nbsp; came across this fantastic &lt;A href="https://blog.gbrueckl.at/2023/08/querying-power-bi-rest-api-using-fabric-spark-sql/" target="_self"&gt;piece&lt;/A&gt; . I have tested it out and it is simply awesome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was wondering if there is&amp;nbsp; a way to utilize any of the &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/" target="_self"&gt;RESTApi&lt;/A&gt; calls here. For example, what if I want to know the refresh history of each dataset. The request URL is following&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it doable? How do I make adjustments to the following to get the refresh history forEach dataset&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('/groups', '${pbi_access_token}')) as workspace
)
SELECT workspace.name, workspace.id, pbi_api_udf(concat(workspace.apiPath, '/datasets'), '${pbi_access_token}') as datasets
FROM cte_workspaces&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Nov 2023 21:17:05 GMT</pubDate>
    <dc:creator>smpa01</dc:creator>
    <dc:date>2023-11-28T21:17:05Z</dc:date>
    <item>
      <title>Custom REST calls</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Custom-REST-calls/m-p/3557303#M938</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/135"&gt;@gbrueckl&lt;/a&gt;&amp;nbsp; came across this fantastic &lt;A href="https://blog.gbrueckl.at/2023/08/querying-power-bi-rest-api-using-fabric-spark-sql/" target="_self"&gt;piece&lt;/A&gt; . I have tested it out and it is simply awesome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was wondering if there is&amp;nbsp; a way to utilize any of the &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/" target="_self"&gt;RESTApi&lt;/A&gt; calls here. For example, what if I want to know the refresh history of each dataset. The request URL is following&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it doable? How do I make adjustments to the following to get the refresh history forEach dataset&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('/groups', '${pbi_access_token}')) as workspace
)
SELECT workspace.name, workspace.id, pbi_api_udf(concat(workspace.apiPath, '/datasets'), '${pbi_access_token}') as datasets
FROM cte_workspaces&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 21:17:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Custom-REST-calls/m-p/3557303#M938</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2023-11-28T21:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom REST calls</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Custom-REST-calls/m-p/3557424#M939</link>
      <description>&lt;P&gt;something like this should technically work&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('https://api.powerbi.com/v1.0/myorg/groups', '${token}')) AS workspace
),
cte_datasets AS (
SELECT workspace.name AS ws_name, workspace.id AS ws_id, explode(pbi_api_udf(concat(workspace.apiPath, '/datasets'), '${token}')) AS dataset
FROM cte_workspaces
)
SELECT ws_name, ws_id, dataset.name AS ds_name, dataset.id AS ds_id,
    explode(pbi_api_udf(concat(dataset.apiPath, '/refreshes'), '${token}')) AS refreshes
FROM cte_datasets&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;but I just tried it on my quite small environment and it errors out with too many requests&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 22:15:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Custom-REST-calls/m-p/3557424#M939</guid>
      <dc:creator>gbrueckl</dc:creator>
      <dc:date>2023-11-28T22:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom REST calls</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Custom-REST-calls/m-p/3559019#M940</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/24978"&gt;@smpa01&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 13:59:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Custom-REST-calls/m-p/3559019#M940</guid>
      <dc:creator>v-cboorla-msft</dc:creator>
      <dc:date>2023-11-29T13:59:47Z</dc:date>
    </item>
  </channel>
</rss>

