<?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 Using Power BI's APIs in powershell scripts - 400 status error in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Using-Power-BI-s-APIs-in-powershell-scripts-400-status-error/m-p/1789790#M29042</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sapphire_0-1618593941596.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/496281i8D69D363230D7A57/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sapphire_0-1618593941596.png" alt="Sapphire_0-1618593941596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello, I am new to powershell and was working on using Power BI REST APIs. I have no problems with the ones using read permissions, but when it comes to the ones to write (POST), i am getting the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception : System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).&lt;BR /&gt;at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()&lt;BR /&gt;at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.&amp;lt;InvokeRestMethod&amp;gt;d__35.MoveNext()&amp;nbsp;&amp;nbsp; (the error is on the image on top!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case i was using the following for the "update parameter in group" REST API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invoke-PowerBIRestMethod -Url $url -Method POST -Body (ConvertTo-Json #body_request)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$body_request = @'&lt;BR /&gt;{&lt;BR /&gt;"updateDetails":&lt;BR /&gt;{&lt;BR /&gt;"name": "ServerName",&lt;BR /&gt;"newValue": "qa-clean"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;'@&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may be wrong, but I read documentation before which told that administrators can use the Power BI APIs without needing to register an app in azure. Is this fact true?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading:)&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 18:46:13 GMT</pubDate>
    <dc:creator>Sapphire</dc:creator>
    <dc:date>2021-04-16T18:46:13Z</dc:date>
    <item>
      <title>Using Power BI's APIs in powershell scripts - 400 status error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Power-BI-s-APIs-in-powershell-scripts-400-status-error/m-p/1789790#M29042</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sapphire_0-1618593941596.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/496281i8D69D363230D7A57/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sapphire_0-1618593941596.png" alt="Sapphire_0-1618593941596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello, I am new to powershell and was working on using Power BI REST APIs. I have no problems with the ones using read permissions, but when it comes to the ones to write (POST), i am getting the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception : System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).&lt;BR /&gt;at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()&lt;BR /&gt;at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.&amp;lt;InvokeRestMethod&amp;gt;d__35.MoveNext()&amp;nbsp;&amp;nbsp; (the error is on the image on top!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case i was using the following for the "update parameter in group" REST API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invoke-PowerBIRestMethod -Url $url -Method POST -Body (ConvertTo-Json #body_request)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$body_request = @'&lt;BR /&gt;{&lt;BR /&gt;"updateDetails":&lt;BR /&gt;{&lt;BR /&gt;"name": "ServerName",&lt;BR /&gt;"newValue": "qa-clean"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;'@&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may be wrong, but I read documentation before which told that administrators can use the Power BI APIs without needing to register an app in azure. Is this fact true?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading:)&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 18:46:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Power-BI-s-APIs-in-powershell-scripts-400-status-error/m-p/1789790#M29042</guid>
      <dc:creator>Sapphire</dc:creator>
      <dc:date>2021-04-16T18:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Power BI's APIs in powershell scripts - 400 status error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Power-BI-s-APIs-in-powershell-scripts-400-status-error/m-p/1790636#M29051</link>
      <description>&lt;P&gt;Try running the same API call in the sandbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparametersingroup#code-try-0" target="_blank"&gt;Datasets - Update Parameters In Group (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 19:17:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Power-BI-s-APIs-in-powershell-scripts-400-status-error/m-p/1790636#M29051</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-04-17T19:17:09Z</dc:date>
    </item>
  </channel>
</rss>

