<?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: Problem when calling Dataset refresh API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/302606#M8920</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/41885"&gt;@Juramirez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find the code in this guide:&amp;nbsp;&lt;A href="http://www.businessintelligenceinfo.com/business-intelligence/self-service-bi/updating-a-powerbi-dataset-using-microsoft-flow-azure-functions-and-a-flic-button" target="_self"&gt;http://www.businessintelligenceinfo.com/business-intelligence/self-service-bi/updating-a-powerbi-dataset-using-microsoft-flow-azure-functions-and-a-flic-button&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or on github:&amp;nbsp;&lt;A href="https://github.com/Azure-Samples/powerbi-powershell/blob/master/manageRefresh.ps1" target="_self"&gt;https://github.com/Azure-Samples/powerbi-powershell/blob/master/manageRefresh.ps1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Diem&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 07:31:08 GMT</pubDate>
    <dc:creator>nphdiem95</dc:creator>
    <dc:date>2017-11-14T07:31:08Z</dc:date>
    <item>
      <title>Problem when calling Dataset refresh API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/249956#M7743</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recently created a Function App to call dataset refresh API. The first call succeeded, but every calls after that raised 400 Bad Request.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="h1.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/59819iEF8998EAB27229FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="h1.png" alt="h1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the reason of this error, and how can I fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Diem&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 09:13:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/249956#M7743</guid>
      <dc:creator>nphdiem95</dc:creator>
      <dc:date>2017-09-12T09:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when calling Dataset refresh API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/250463#M7758</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/38831"&gt;@nphdiem95&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recently created a Function App to call dataset refresh API. The first call succeeded, but every calls after that raised 400 Bad Request.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="h1.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/59819iEF8998EAB27229FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="h1.png" alt="h1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the reason of this error, and how can I fix it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diem&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/38831"&gt;@nphdiem95&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Instead of the simple 400 error, try to output the details error message with try catch block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$groupsPath ="dc581184-a209-463b-8446-5432f16b6c15" 
$datasetID = "1f6285a5-7b98-4758-8f81-77b7ae5637d6"

$headers = @{}
$headers.Add("Authorization","Bearer eyJxxxxxxxxxxxxxxQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsImlhdCI6MTUwNTI3MDA5NSwibmJmIjoxNTA1MjcwMDk1LCJleHAiOjE1MDUyNzM5OTUsImFjciI6IjEiLCJhaW8iOiJZMlZnWUxEOFhTdkt6bXEyc09HSDFINmR4U1p6VXJRVFRrMTIyMjcrYVZWZnZQTVI5dHNBIiwiYW1yIjpbInB3ZCJdLCJhcHBpZCI6IjQ5ZGYxYmM3LWRiNjgtNGZiNC05MWMwLTZkOTNmNzcwZDFhNCIsImFwcGlkYWNyIjoiMCIsImZhbWlseV9uYW1lIjoiWmhhbmciLCJnaXZlbl9uYW1lIjoiRXJpYyIsImlwYWRkciI6IjE2Ny4yMjAuMjU1LjgiLCJuYW1lIjoiRXJpYyBaaGFuZyAoU2hhbmcgSGFpIFdlaSBDaHVhbmcgUnVhbiBKaWFuKSI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ets/$datasetID/refreshes"

try{
Invoke-WebRequest -Uri $uri -Headers $headers -Method POST
}

catch [Net.WebException] {

$ex=$_

if  ($ex-ne$null) {
$resp=$ex.Exception.Response;
$rs=$resp.GetResponseStream();
[System.IO.StreamReader]$sr=New-Object System.IO.StreamReader($rs);
[string]$results=$sr.ReadToEnd();

Write-Host $results

            }

}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 03:01:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/250463#M7758</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-09-13T03:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when calling Dataset refresh API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/302334#M8913</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/38831"&gt;@nphdiem95&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Where did you find examples to do this? Can you provide me the example code?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 20:57:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/302334#M8913</guid>
      <dc:creator>Juramirez</dc:creator>
      <dc:date>2017-11-13T20:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when calling Dataset refresh API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/302606#M8920</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/41885"&gt;@Juramirez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find the code in this guide:&amp;nbsp;&lt;A href="http://www.businessintelligenceinfo.com/business-intelligence/self-service-bi/updating-a-powerbi-dataset-using-microsoft-flow-azure-functions-and-a-flic-button" target="_self"&gt;http://www.businessintelligenceinfo.com/business-intelligence/self-service-bi/updating-a-powerbi-dataset-using-microsoft-flow-azure-functions-and-a-flic-button&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or on github:&amp;nbsp;&lt;A href="https://github.com/Azure-Samples/powerbi-powershell/blob/master/manageRefresh.ps1" target="_self"&gt;https://github.com/Azure-Samples/powerbi-powershell/blob/master/manageRefresh.ps1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Diem&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 07:31:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/302606#M8920</guid>
      <dc:creator>nphdiem95</dc:creator>
      <dc:date>2017-11-14T07:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when calling Dataset refresh API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/399096#M11883</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having the same problem now. I am using c#, now after the first success I get a 400 error every time. How did you solve your problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 11:08:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/399096#M11883</guid>
      <dc:creator>alexisc67</dc:creator>
      <dc:date>2018-04-18T11:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when calling Dataset refresh API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/412802#M12294</link>
      <description>&lt;P&gt;I was in the same situation and&amp;nbsp;this helped me to understand that the error was due to an excessive number of request (more than &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; in the 24 hours, thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 12:38:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-when-calling-Dataset-refresh-API/m-p/412802#M12294</guid>
      <dc:creator>realquo</dc:creator>
      <dc:date>2018-05-08T12:38:45Z</dc:date>
    </item>
  </channel>
</rss>

