<?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 Re: Methods available to datamart API in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040051#M3002</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; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documenation does not list any method for datamart&lt;/P&gt;
&lt;P&gt;yet the following succeeds&amp;nbsp; on a workspace_apiPath&amp;nbsp; concat('&lt;SPAN&gt;/groups/abcdef-ghij-klmn-opqr-stuvwx',&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="color: #000000; background-color: #ffffff; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 18px; white-space: pre;"&gt;
&lt;DIV&gt;&lt;SPAN&gt;'/datamarts'&lt;/SPAN&gt;) that made me think that I might be able to call other methods.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I am little confused here as datamrts don't have any API methods yet it succedds&lt;/DIV&gt;
&lt;DIV&gt;and I thought I would be able to call additional methods on apiPath? &lt;/DIV&gt;
&lt;/DIV&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;
&lt;LI-CODE lang="markup"&gt;cteThree as (    
select dm
from cteTwo
LATERAL VIEW explode(pbi_api_udf(concat( workspace_apiPath, '/datamarts'), '${pbi_access_token}')) AS dm
)

the above returns an object
{
		"capabilities": "4",
		"lastRefreshTimeUTC": "2024-05-28T22:47:54.263Z",
		"modifiedByUser": "{displayName=user, userPrincipalName=user@company.com, objectId=9e1103aa-a128-4bec-8b8e-d1004422b3b7}",
		"name": "DEV",
		"state": "1",
		"datasetObjectId": "f331fd8e-b3ce-4b24-90aa-c5a0d6699aaf",
		"lastRefreshStatus": "1",
		"datamartType": "Sql",
		"apiPath": "/groups/grpID/datamarts",
		"nextRefreshTimeUTC": "9999-12-31T23:59:59.997Z",
		"datasetId": "1955466",
		"version": "638477205269348724",
		"ownerUser": "{displayName=user, userPrincipalName=user@company.com, objectId=9e1103aa-a128-4bec-8b8e-d1004422b3b7}",
		"lastModifiedTimeUTC": "2024-05-29T00:58:29.79",
		"status": "1",
		"objectId": "245952d6-0487-4f2a-abcb-89689d4813c5",
		"folderObjectId": "f8a6fefa-0df7-4fe7-ac93-dc0a9003594e",
		"dataflowObjectId": "659bd422-955c-43b7-8304-4e50b8f1ab48",
		"createdDate": "2024-05-28T15:06:43.76"
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2024 19:13:02 GMT</pubDate>
    <dc:creator>smpa01</dc:creator>
    <dc:date>2024-07-12T19:13:02Z</dc:date>
    <item>
      <title>Methods available to datamart API</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040034#M3000</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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the following method on datamart just to test if refreshes method is avaialble to datamart apiPath ( as it is availabale to dataset apiPath)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;-- the following returns error on datamart
%%sql

WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('/groups', '${pbi_access_token}')) as workspace
)
, cteTwo as (
select workspace.name as workspace_name,workspace.id as workspace_id,workspace.apiPath as workspace_apiPath
from cte_workspaces
WHERE workspace.name = 'Production'
    )
, cteThree as (    
select * 
    ,dm.apiPath as apiPath
from cteTwo
LATERAL VIEW explode(pbi_api_udf(concat( workspace_apiPath, '/datamarts'), '${pbi_access_token}')) AS dm
)
select *
from cteThree
LATERAL VIEW explode(pbi_api_udf(concat( apiPath, '/refreshes'), '${pbi_access_token}')) AS refreshes



-- the following works perfectly on dataset (semantic model)
%%sql

WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('/groups', '${pbi_access_token}')) as workspace
)
, cteB as (
select 
    workspace.name as workspace_name
    ,workspace.id as workspace_id
    ,workspace.apiPath as workspace_apiPath   
    ,datasets.name as ds_name   
    ,datasets.apiPath as apiPath  
from cte_workspaces
LATERAL VIEW explode(pbi_api_udf(concat(workspace.apiPath, '/datasets'), '${pbi_access_token}')) datasetsTable AS datasets
WHERE workspace.name = 'Production'
    )
select * 
FROM cteB
LATERAL VIEW explode(pbi_api_udf(concat( apiPath, '/refreshes'), '${pbi_access_token}')) AS refreshes&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it returns {"error":"Not Found","status_code":"404"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How am I to know, what methods are avaialble to the datamart apiPath? Does there exists a documentation that says what methods are available to what artifacts?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 18:34:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040034#M3000</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2024-07-12T18:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Methods available to datamart API</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040040#M3001</link>
      <description>&lt;P&gt;I just checked the docs (&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets" target="_blank"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/datasets&lt;/A&gt;) and it seems there are no APIs for datamarts hence you cannot query them with my code from above&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 18:37:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040040#M3001</guid>
      <dc:creator>gbrueckl</dc:creator>
      <dc:date>2024-07-12T18:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Methods available to datamart API</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040051#M3002</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; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documenation does not list any method for datamart&lt;/P&gt;
&lt;P&gt;yet the following succeeds&amp;nbsp; on a workspace_apiPath&amp;nbsp; concat('&lt;SPAN&gt;/groups/abcdef-ghij-klmn-opqr-stuvwx',&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="color: #000000; background-color: #ffffff; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 18px; white-space: pre;"&gt;
&lt;DIV&gt;&lt;SPAN&gt;'/datamarts'&lt;/SPAN&gt;) that made me think that I might be able to call other methods.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I am little confused here as datamrts don't have any API methods yet it succedds&lt;/DIV&gt;
&lt;DIV&gt;and I thought I would be able to call additional methods on apiPath? &lt;/DIV&gt;
&lt;/DIV&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;
&lt;LI-CODE lang="markup"&gt;cteThree as (    
select dm
from cteTwo
LATERAL VIEW explode(pbi_api_udf(concat( workspace_apiPath, '/datamarts'), '${pbi_access_token}')) AS dm
)

the above returns an object
{
		"capabilities": "4",
		"lastRefreshTimeUTC": "2024-05-28T22:47:54.263Z",
		"modifiedByUser": "{displayName=user, userPrincipalName=user@company.com, objectId=9e1103aa-a128-4bec-8b8e-d1004422b3b7}",
		"name": "DEV",
		"state": "1",
		"datasetObjectId": "f331fd8e-b3ce-4b24-90aa-c5a0d6699aaf",
		"lastRefreshStatus": "1",
		"datamartType": "Sql",
		"apiPath": "/groups/grpID/datamarts",
		"nextRefreshTimeUTC": "9999-12-31T23:59:59.997Z",
		"datasetId": "1955466",
		"version": "638477205269348724",
		"ownerUser": "{displayName=user, userPrincipalName=user@company.com, objectId=9e1103aa-a128-4bec-8b8e-d1004422b3b7}",
		"lastModifiedTimeUTC": "2024-05-29T00:58:29.79",
		"status": "1",
		"objectId": "245952d6-0487-4f2a-abcb-89689d4813c5",
		"folderObjectId": "f8a6fefa-0df7-4fe7-ac93-dc0a9003594e",
		"dataflowObjectId": "659bd422-955c-43b7-8304-4e50b8f1ab48",
		"createdDate": "2024-05-28T15:06:43.76"
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 19:13:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040051#M3002</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2024-07-12T19:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Methods available to datamart API</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040091#M3004</link>
      <description>&lt;P&gt;thats indeed interesting as this API is not mentioned anywhere &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;neither in the docs nor in the SDK&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/microsoft/PowerBI-CSharp/blob/master/sdk/swaggers/swagger.json" target="_blank"&gt;https://github.com/microsoft/PowerBI-CSharp/blob/master/sdk/swaggers/swagger.json&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 19:20:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Methods-available-to-datamart-API/m-p/4040091#M3004</guid>
      <dc:creator>gbrueckl</dc:creator>
      <dc:date>2024-07-12T19:20:30Z</dc:date>
    </item>
  </channel>
</rss>

