<?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: Refresh Dataset API returns 400 Bad Request when refresh is in progress in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/222580#M7030</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;I am getting "Invalid Dataset. This API can only be called on a Model-base dataset" when I use your demo.. Not sure what it means.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What is the datasource in your dataset?&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 02:06:18 GMT</pubDate>
    <dc:creator>Eric_Zhang</dc:creator>
    <dc:date>2017-08-01T02:06:18Z</dc:date>
    <item>
      <title>Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/211190#M6720</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm making use of the new Dataset Refresh API, and the &lt;A href="https://msdn.microsoft.com/en-us/library/mt784652.aspx" target="_self"&gt;documentation &lt;/A&gt;states that a status code of &lt;STRONG&gt;409 Conflict&lt;/STRONG&gt; is returned when a refresh is already executing. However, I am receiving a &lt;STRONG&gt;400 Bad Request&lt;/STRONG&gt; for that exact scenario. I would prefer it if the implementation was matching the docs, hence if it was possible to distinguish the refresh-in-progress condition from any other generic API errors. Querying the Refresh History endpoint instead is not a viable alternative either because it only returns a status of "Unknown" when a refresh is in progress - again, making it impossible to distinguish that state from any other that might be deemed "unknown",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 10:02:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/211190#M6720</guid>
      <dc:creator>mthierba</dc:creator>
      <dc:date>2017-07-13T10:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/212858#M6721</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/5519"&gt;@mthierba&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm making use of the new Dataset Refresh API, and the &lt;A href="https://msdn.microsoft.com/en-us/library/mt784652.aspx" target="_self"&gt;documentation &lt;/A&gt;states that a status code of &lt;STRONG&gt;409 Conflict&lt;/STRONG&gt; is returned when a refresh is already executing. However, I am receiving a &lt;STRONG&gt;400 Bad Request&lt;/STRONG&gt; for that exact scenario. I would prefer it if the implementation was matching the docs, hence if it was possible to distinguish the refresh-in-progress condition from any other generic API errors. Querying the Refresh History endpoint instead is not a viable alternative either because it only returns a status of "Unknown" when a refresh is in progress - again, making it impossible to distinguish that state from any other that might be deemed "unknown",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Mathias&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/5519"&gt;@mthierba&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks for reporting that. I can reproduce the behavior of returning 400 while 409 is expected. I'm going to consulting this internally and as a workaround, you cound find the 400 error message to determine "refresh is executing".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        static void refreshDataset(string groupId, string datasetId)
        {

            HttpWebRequest request = System.Net.HttpWebRequest.CreateHttp(String.Format("https://api.powerbi.com/v1.0/myorg/groups/{0}/datasets/{1}/refreshes", groupId, datasetId));
            //POST web request to create a datasource.
            request.KeepAlive = true;
            request.Method = "POST";
            request.ContentLength = 0;

            //Add token to the request header
            request.Headers.Add("Authorization", String.Format("Bearer {0}", token));

            try
            {
                //Write JSON byte[] into a Stream
                using (Stream writer = request.GetRequestStream())
                {

                    var response = (HttpWebResponse)request.GetResponse();
                    Console.WriteLine("Dataset refresh request {0}", response.StatusCode.ToString());
                }
            }
            catch (WebException wex)
            {
                if (wex.Response != null)
                {
                    using (var errorResponse = (HttpWebResponse)wex.Response)
                    {
                        using (var reader = new StreamReader(errorResponse.GetResponseStream()))
                        {
                            &lt;STRONG&gt;string errorString = reader.ReadToEnd();
                            dynamic respJson = JsonConvert.DeserializeObject&amp;lt;dynamic&amp;gt;(errorString);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;                            //if refreshing is executing, the output would be "Invalid dataset refresh request. Another refresh request is already executing"
                            Console.WriteLine(respJson["error"]["message"]);&lt;/STRONG&gt; 
                        }
                    }
                }
            } 
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 08:47:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/212858#M6721</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-07-17T08:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/215037#M6780</link>
      <description>&lt;P&gt;I am always getting the &amp;nbsp;"&lt;SPAN&gt;Operation returned an invalid status code 'UnsupportedMediaType'" error everytime I try to refresh a dataset.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Snippet&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&amp;nbsp;refreshData&amp;nbsp;&lt;SPAN&gt;=&lt;/SPAN&gt;&amp;nbsp;client&lt;SPAN&gt;.&lt;/SPAN&gt;Datasets&lt;SPAN&gt;.&lt;/SPAN&gt;RefreshDatasetInGroup(cloneGroup&lt;SPAN&gt;.&lt;/SPAN&gt;Id,&amp;nbsp;report&lt;SPAN&gt;.&lt;/SPAN&gt;DatasetId)&amp;nbsp;&lt;SPAN&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;Datasets&lt;/SPAN&gt;;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 17:54:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/215037#M6780</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-19T17:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/215264#M6782</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I am always getting the &amp;nbsp;"&lt;SPAN&gt;Operation returned an invalid status code 'UnsupportedMediaType'" error everytime I try to refresh a dataset.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Snippet&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&amp;nbsp;refreshData&amp;nbsp;&lt;SPAN&gt;=&lt;/SPAN&gt;&amp;nbsp;client&lt;SPAN&gt;.&lt;/SPAN&gt;Datasets&lt;SPAN&gt;.&lt;/SPAN&gt;RefreshDatasetInGroup(cloneGroup&lt;SPAN&gt;.&lt;/SPAN&gt;Id,&amp;nbsp;report&lt;SPAN&gt;.&lt;/SPAN&gt;DatasetId)&amp;nbsp;&lt;SPAN&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;Datasets&lt;/SPAN&gt;;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What is the dataset in your case? What if you go with my demo calling REST API instead of using the SDK?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 02:27:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/215264#M6782</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-07-20T02:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/218067#M6862</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;I am getting "Invalid Dataset. This API can only be called on a Model-base dataset" when I use your demo.. Not sure what it means.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 23:25:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/218067#M6862</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-24T23:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/222580#M7030</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;I am getting "Invalid Dataset. This API can only be called on a Model-base dataset" when I use your demo.. Not sure what it means.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What is the datasource in your dataset?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 02:06:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/222580#M7030</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-08-01T02:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/358780#M10680</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing the same issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting "&lt;SPAN&gt;Operation returned an invalid status code 'UnsupportedMediaType'" using the SDK as well as the REST API&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;@Anonymous&lt;/a&gt;&amp;nbsp;Were you able to resolve the issue?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 11:09:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/358780#M10680</guid>
      <dc:creator>hskrishna</dc:creator>
      <dc:date>2018-02-15T11:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Dataset API returns 400 Bad Request when refresh is in progress</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/359463#M10696</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt; - Able to get it to work in Import mode. Earlier I&amp;nbsp;was trying the refresh with DirectQuery.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess Refresh for datasets in DirectQuery mode isn't supported.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 09:56:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Refresh-Dataset-API-returns-400-Bad-Request-when-refresh-is-in/m-p/359463#M10696</guid>
      <dc:creator>hskrishna</dc:creator>
      <dc:date>2018-02-16T09:56:51Z</dc:date>
    </item>
  </channel>
</rss>

