<?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: Difference between via Api and via Enhanced Api in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Difference-between-via-Api-and-via-Enhanced-Api/m-p/3335485#M43495</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/566919"&gt;@RamyaRascher&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The Power BI REST API is a REST-based API that provides programmatic access to Dashboard resources such as Datasets, Tables, and Rows in Power BI. The Enhanced API is a new version of the Power BI REST API that provides additional functionality and performance improvements over the previous version. The Enhanced API is currently in preview and is available to use alongside the existing Power BI REST API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To clear the data in the partitions of a Power BI dataset using PowerShell, you can use the &lt;A href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.3" target="_self"&gt;Invoke-RestMethod&lt;/A&gt; cmdlet in PowerShell to call the Power BI REST API and send a &lt;STRONG&gt;DELETE &lt;/STRONG&gt;request to the partitions endpoint of the dataset. Here is an example PowerShell script that clears the data in the partitions of a dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;$token = &lt;SPAN class=""&gt;Get-PowerBIAccessToken
&lt;SPAN class=""&gt;$authHeader = &lt;SPAN class=""&gt;@{ &lt;SPAN class=""&gt;'Authorization' = &lt;SPAN class=""&gt;"Bearer &lt;SPAN class=""&gt;$token" }
&lt;SPAN class=""&gt;$datasetId = &lt;SPAN class=""&gt;'&amp;lt;your dataset ID&amp;gt;'
&lt;SPAN class=""&gt;$partitionsEndpoint = &lt;SPAN class=""&gt;"https://api.powerbi.com/v1.0/myorg/datasets/&lt;SPAN class=""&gt;$datasetId/partitions"
&lt;SPAN class=""&gt;Invoke-RestMethod &lt;SPAN class=""&gt;-Uri &lt;SPAN class=""&gt;$partitionsEndpoint &lt;SPAN class=""&gt;-Headers &lt;SPAN class=""&gt;$authHeader &lt;SPAN class=""&gt;-Method DELETE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;This script first gets an access token for the Power BI REST API using the &lt;STRONG&gt;Get-PowerBIAccessToken&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cmdlet. It then constructs an authorization header using the access token. The script then specifies the dataset ID and constructs the partitions endpoint URL. Finally, the script sends a DELETE request to the partitions endpoint using the &lt;STRONG&gt;Invoke-RestMethod&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cmdlet to clear the data in the partitions of the dataset。&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jul 2023 02:33:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-07-18T02:33:00Z</dc:date>
    <item>
      <title>Difference between via Api and via Enhanced Api</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Difference-between-via-Api-and-via-Enhanced-Api/m-p/3324769#M43424</link>
      <description>&lt;P&gt;I am trying to deploy reports to workspaces using PowerShell scripts. Our organization uses the same pbix file skeleton and changes to client datasource in their respective workspaces. We achieve this by connecting first to an empty database and once published, change to client specific data sources and credentials. We also have the Incremental refresh set up for these reports.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The flow of report deployment goes as follow,&amp;nbsp;&lt;/P&gt;&lt;P&gt;publish the report with empty db --&amp;gt; full refresh to create partitions --&amp;gt; "ClearValues" refresh to clear values in partition --&amp;gt; update datasource and credentials --&amp;gt; transactional refresh.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do this to clear the values in partitions and fill them with client data for the created partitions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The challenge is the API call I make to clear values in the partition is not working as expected. The call is made successfully but it is not clearing the values. Hence, when the last call is made, correct data is not filled in the existing partitions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also noticed that refresh types for these calls are Via Api instead of Via Enhanced Api.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone else experienced this? Does anyone maybe have a more elegant solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 08:55:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Difference-between-via-Api-and-via-Enhanced-Api/m-p/3324769#M43424</guid>
      <dc:creator>RamyaRascher</dc:creator>
      <dc:date>2023-07-11T08:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between via Api and via Enhanced Api</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Difference-between-via-Api-and-via-Enhanced-Api/m-p/3335485#M43495</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/566919"&gt;@RamyaRascher&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The Power BI REST API is a REST-based API that provides programmatic access to Dashboard resources such as Datasets, Tables, and Rows in Power BI. The Enhanced API is a new version of the Power BI REST API that provides additional functionality and performance improvements over the previous version. The Enhanced API is currently in preview and is available to use alongside the existing Power BI REST API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To clear the data in the partitions of a Power BI dataset using PowerShell, you can use the &lt;A href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.3" target="_self"&gt;Invoke-RestMethod&lt;/A&gt; cmdlet in PowerShell to call the Power BI REST API and send a &lt;STRONG&gt;DELETE &lt;/STRONG&gt;request to the partitions endpoint of the dataset. Here is an example PowerShell script that clears the data in the partitions of a dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;$token = &lt;SPAN class=""&gt;Get-PowerBIAccessToken
&lt;SPAN class=""&gt;$authHeader = &lt;SPAN class=""&gt;@{ &lt;SPAN class=""&gt;'Authorization' = &lt;SPAN class=""&gt;"Bearer &lt;SPAN class=""&gt;$token" }
&lt;SPAN class=""&gt;$datasetId = &lt;SPAN class=""&gt;'&amp;lt;your dataset ID&amp;gt;'
&lt;SPAN class=""&gt;$partitionsEndpoint = &lt;SPAN class=""&gt;"https://api.powerbi.com/v1.0/myorg/datasets/&lt;SPAN class=""&gt;$datasetId/partitions"
&lt;SPAN class=""&gt;Invoke-RestMethod &lt;SPAN class=""&gt;-Uri &lt;SPAN class=""&gt;$partitionsEndpoint &lt;SPAN class=""&gt;-Headers &lt;SPAN class=""&gt;$authHeader &lt;SPAN class=""&gt;-Method DELETE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;This script first gets an access token for the Power BI REST API using the &lt;STRONG&gt;Get-PowerBIAccessToken&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cmdlet. It then constructs an authorization header using the access token. The script then specifies the dataset ID and constructs the partitions endpoint URL. Finally, the script sends a DELETE request to the partitions endpoint using the &lt;STRONG&gt;Invoke-RestMethod&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cmdlet to clear the data in the partitions of the dataset。&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 02:33:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Difference-between-via-Api-and-via-Enhanced-Api/m-p/3335485#M43495</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-18T02:33:00Z</dc:date>
    </item>
  </channel>
</rss>

