<?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: 403 Forbidden error occured when using REST API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/78966#M2776</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15287"&gt;@hari_seenivasan&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Try the following API end point&lt;/P&gt;&lt;P&gt;I believe its still in beta mode.&lt;/P&gt;&lt;PRE&gt;https://api.powerbi.com/beta/myorg/datasets&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;It&amp;nbsp;works with the same&amp;nbsp;403 status code.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2016 08:50:14 GMT</pubDate>
    <dc:creator>s8nRrG</dc:creator>
    <dc:date>2016-10-17T08:50:14Z</dc:date>
    <item>
      <title>403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/71005#M2349</link>
      <description>&lt;P&gt;I'm developing API that allows to send data directly to Power BI. There must not be any user's interaction to authenticate the request. The user can set only clientId and clientSecret values.&amp;nbsp;But&amp;nbsp;all my requests retrun 403 status code. For instance, let's look at my code that I use to get data&amp;nbsp;about all my datasets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private static string GetAccessToken()
{
    const string clientId = "valid client id";
    const string clientSecret = "valid client secret";
    var clientCredentials = new ClientCredential(clientId, clientSecret);
    const string authorityUri = "https://login.windows.net/common/oauth2/authorize";
    const string resourceUri = "https://analysis.windows.net/powerbi/api";
	
    authContext = new AuthenticationContext(authorityUri, new TokenCache());
    var token = authContext.AcquireTokenAsync(resourceUri, clientCredentials).Result.AccessToken;
    return token;
}

private static string GetDatasets()
{
    var powerBIApiUrl = "https://api.powerbi.com/v1.0/myorg/datasets";

    var token = GetAccessToken();

    HttpWebRequest request = WebRequest.Create(powerBIApiUrl) as HttpWebRequest;
    request.Method = "GET";
    request.ContentLength = 0;

    request.Headers.Add("Authorization", $"Bearer {token}");&lt;BR /&gt;
    &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;// 403 The remote server returned an error: (403) Forbidden.&lt;/STRONG&gt;&lt;/FONT&gt;
    using (var httpResponse = request.GetResponse() as HttpWebResponse
    {
        using (var reader = new StreamReader(httpResponse.GetResponseStream()))
        {
            var responseContent = reader.ReadToEnd();
            return responseContent;
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get token "eyJ0...cceA" that seems valid. However,&amp;nbsp;request.GetResponse() returns 403 status code. A&lt;SPAN&gt;ll permissions were delegated to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Power BI Service in in Azure Active Directory.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you have any idea how to fix&amp;nbsp;this? I really appreciate any help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/71005#M2349</guid>
      <dc:creator>s8nRrG</dc:creator>
      <dc:date>2016-09-22T14:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/72021#M2392</link>
      <description>&lt;P&gt;Can you post the complete code？&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 14:12:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/72021#M2392</guid>
      <dc:creator>KumarDarmesh</dc:creator>
      <dc:date>2016-09-26T14:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/72030#M2395</link>
      <description>&lt;P&gt;I hope your registered your app with Azure Active directory &amp;nbsp;and provided proper clientid,clientkey,username and pwd.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://login.microsoftonline.com/" target="_blank"&gt;https://login.microsoftonline.com/&lt;/A&gt;&lt;STRONG&gt;yourdirectorykey&lt;/STRONG&gt;/oauth2/token&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Provide proper directory key to resolve your issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you need any further details&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 14:23:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/72030#M2395</guid>
      <dc:creator>Sunkari</dc:creator>
      <dc:date>2016-09-26T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/78696#M2761</link>
      <description>&lt;P&gt;Try the following API end point&lt;/P&gt;&lt;P&gt;I believe its still in beta mode.&lt;/P&gt;&lt;PRE&gt;https://api.powerbi.com/beta/myorg/datasets&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Oct 2016 14:46:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/78696#M2761</guid>
      <dc:creator>hari_seenivasan</dc:creator>
      <dc:date>2016-10-15T14:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/78965#M2775</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/9025"&gt;@Sunkari&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;I hope your registered your app with Azure Active directory &amp;nbsp;and provided proper clientid,clientkey,username and pwd.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://login.microsoftonline.com/" target="_blank"&gt;https://login.microsoftonline.com/&lt;/A&gt;&lt;STRONG&gt;yourdirectorykey&lt;/STRONG&gt;/oauth2/token&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Provide proper directory key to resolve your issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you need any further details&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I use correct directory key. If I used wrong directory key, I'd got the&amp;nbsp;exception &lt;/SPAN&gt;&lt;EM&gt;No service namespace named 'wrong directory key' was found in the data store&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;during obtaining access token.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 08:49:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/78965#M2775</guid>
      <dc:creator>s8nRrG</dc:creator>
      <dc:date>2016-10-17T08:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/78966#M2776</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15287"&gt;@hari_seenivasan&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Try the following API end point&lt;/P&gt;&lt;P&gt;I believe its still in beta mode.&lt;/P&gt;&lt;PRE&gt;https://api.powerbi.com/beta/myorg/datasets&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;It&amp;nbsp;works with the same&amp;nbsp;403 status code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 08:50:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/78966#M2776</guid>
      <dc:creator>s8nRrG</dc:creator>
      <dc:date>2016-10-17T08:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/95040#M3354</link>
      <description>&lt;P&gt;Redirect response to HTML and share here, we will get more details on what went wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 06:00:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/95040#M3354</guid>
      <dc:creator>hari_seenivasan</dc:creator>
      <dc:date>2016-11-29T06:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/107817#M3763</link>
      <description>&lt;P&gt;Can you please elaborate on where the username/password go?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 00:11:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/107817#M3763</guid>
      <dc:creator>kalcey</dc:creator>
      <dc:date>2016-12-31T00:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/120923#M4175</link>
      <description>&lt;P&gt;I am having this same problem. I get a valid token, but when I pass the request, I get the HTTP Error 403: Forbidden. In Azure AD, I delegated permissions, and I tested sending request through Apiary and it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have a solution?&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;Alan&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 18:55:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/120923#M4175</guid>
      <dc:creator>alanhodgson</dc:creator>
      <dc:date>2017-01-31T18:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/121531#M4187</link>
      <description>&lt;P&gt;Anyone find a solution to this?&amp;nbsp; I'm having the same issue.&amp;nbsp; We receive the access token in our REST service and I'm passing it to the Power&amp;nbsp;BI REST api and we get this same error.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 20:55:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/121531#M4187</guid>
      <dc:creator>nlombardiCL</dc:creator>
      <dc:date>2017-02-01T20:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/121532#M4188</link>
      <description>&lt;P&gt;Anyone find a solution to this issue?&amp;nbsp; We are getting the same thing when we pass the access token we get in our REST service to the Power BI REST service APIs.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 21:00:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/121532#M4188</guid>
      <dc:creator>nlombardiCL</dc:creator>
      <dc:date>2017-02-01T21:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/122189#M4204</link>
      <description>&lt;P&gt;We are having the same issue as well, anyone have any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 22:00:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/122189#M4204</guid>
      <dc:creator>silmar</dc:creator>
      <dc:date>2017-02-02T22:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/123221#M4262</link>
      <description>&lt;P&gt;I'm having the same error message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using an angular2 SPA to interact with our REST API services.&amp;nbsp; We have a report service that we would like to use to call the Power BI REST API service endpoints.&amp;nbsp; We acquire an azure AD accessToken in our service and try and use that token for the PowerBI calls but keep getting the "The remote server returned an error: (403) Forbidden." error.&amp;nbsp; Our SPA is registered in Azure and we have given Power BI permissions to the application.&amp;nbsp; I have an account in Power BI as well.&amp;nbsp; Below is the code I am using to call the GetReports endpoint. The error is thrown when the GetResponse is called.&amp;nbsp; Any suggestions would be greatly appeciated.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; accessToken = Request.Headers.Authorization.Parameter;&lt;/FONT&gt;&amp;nbsp; //defined in controller and passed to method below.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Uri&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; baseAddress = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Uri&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"&lt;A title="" href="https://api.powerbi.com/" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer"&gt;&lt;FONT color="#0066cc"&gt;https://api.powerbi.com/&lt;/FONT&gt;&lt;/A&gt;"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;);&lt;/FONT&gt;&amp;nbsp;&amp;nbsp; //defined above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;public&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;async&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Task&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;List&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;PbiReport&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt;&amp;gt; GetPBIReports(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;string&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; accessToken)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;string&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; responseData;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; powerBiApiUrl = baseAddress + &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"v1.0/myorg/reports"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;List&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;PbiReport&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt; reports = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;List&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;PbiReport&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt;();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;HttpWebRequest&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; request = &lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;WebRequest&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.Create(powerBiApiUrl) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;HttpWebRequest&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;request.KeepAlive = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;true&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;request.Method = &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"GET"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;request.ContentLength = 0;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;request.ContentType = &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"application/json"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;request.Headers.Add(&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"Authorization"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;$"Bearer &lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;{accessToken}&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;using&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;HttpWebResponse&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; response = request.GetResponse() &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;HttpWebResponse&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;using&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;StreamReader&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; reader = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;StreamReader&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(response.GetResponseStream()))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;reports = &lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;JsonConvert&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.DeserializeObject&amp;lt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;List&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;PbiReport&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt;&amp;gt;(reader.ReadToEnd());&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;return&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; reports;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 14:19:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/123221#M4262</guid>
      <dc:creator>nlombardiCL</dc:creator>
      <dc:date>2017-02-06T14:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/123246#M4264</link>
      <description>&lt;P&gt;On my end, I was doing it wrong. &amp;nbsp;If your goal is to&amp;nbsp;simply trying to provide access to PowerBi reports to your users, and want to authenticate non-interactively,&amp;nbsp;then you may consider grabbing using the PowerBi api from nuget. &amp;nbsp;I posted &lt;A href="http://stackoverflow.com/questions/41862970/getting-403-forbidden-when-authenticating-non-interactively-to-azure-rest-api-fo/42028912#42028912" target="_self"&gt;what ultimately worked for me in my StackOverflow post&lt;/A&gt;. &amp;nbsp;Maybe it will help in your case?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 15:05:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/123246#M4264</guid>
      <dc:creator>silmar</dc:creator>
      <dc:date>2017-02-06T15:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/160737#M5405</link>
      <description>&lt;P&gt;I'm not sure what you mean when you say 'all Power BI permissions were delegated in AAD', can you share more details? &amp;nbsp; Here's something to try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Power BI has a tile embed sample, which I verified works correctly with interactive user login. Note, that when you're using Power BI.com, the user needs to be an AAD user and needs to login as themselves for licensing reason. &amp;nbsp;As someone alluded to in another comment if you want to not use AAD users, you'd use Power BI Embedded, which doesn't require the end user to be an AAD user.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__powerbi.microsoft.com_en-2Dus_documentation_powerbi-2Ddeveloper-2Dintegrate-2Dtile_%26d%3DDwMFAg%26c%3Dfa_WZs7nNMvOIDyLmzi2sMVHyyC4hN9WQl29lWJQ5Y4%26r%3DlziRHguINJltMuH2_R-xlJMtQq9UK3TMda5s7p98pRA%26m%3DE3Tu5xEBa_SDbCwVIMjkyu_Ge_hwEvXostawbPkV5BU%26s%3Das-2eobfURiyRdjtQxW6KDU6Kd4Wlzt4zUBfzz8YOq8%26e%3D&amp;amp;data=02%7C01%7Clukaszp%40microsoft.com%7C3a553545229a40d2ceab08d486aa4a2d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636281513325137264&amp;amp;sdata=Uc2IY0wTQaqL5VvnzKuqrUHWTVo2F5WkvyTOZ4mTIZ0%3D&amp;amp;reserved=0" target="_blank"&gt;https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-tile/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you use your client ID and secret with the above sample and see if it works. &amp;nbsp;Make sure the application has the following redirect URL configured:&lt;/P&gt;&lt;P&gt;“&lt;A href="Http://localhost:13526/" target="_blank"&gt;Http://localhost:13526/&lt;/A&gt;”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually, you get a 403 when the application does not have appropriate permissions. Remember that if you added permissions (scopes) to the application AFTER the user trusted the application, the user’s token won’t get the new scopes until they remove trust from the application and trust it again. Easiest workaround is to create a new application and use that instead. &amp;nbsp;Alternative is to manually remove the application using Office 365’s “my apps” feature and then try to use the application again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might also draw inspiration from several other similar threads from other services:&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/31735264/403-forbidden-from-azure-graph-api" target="_blank"&gt;http://stackoverflow.com/questions/31735264/403-forbidden-from-azure-graph-api&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications#BKMK_Updating" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications#BKMK_Updating&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-developers-guide" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-developers-guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;-Lukasz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 22:41:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/160737#M5405</guid>
      <dc:creator>lukaszp</dc:creator>
      <dc:date>2017-04-18T22:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/160751#M5406</link>
      <description>&lt;P&gt;The issue is that the default registration of an app in Azure AD requires the user click a button saying "I trust" this app. If you look at this video:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="https://www.youtube.com/watch?v=ZSaBFf3ziUk" href="https://www.youtube.com/watch?v=ZSaBFf3ziUk" target="_blank"&gt;https://www.youtube.com/watch?v=ZSaBFf3ziUk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and go into the video about the 2:15 mark. This shows with simple app registration there is a one-time need for user interaction. After logging the first time with user interaction, your code can then authenticate programmatically without user interaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a way around this. It requires that you have an Azure subscription and that you use the Azure portal to register the app and configure security settings so that it doesn't require interactive consent on the part of the user.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 00:03:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/160751#M5406</guid>
      <dc:creator>TedPattison</dc:creator>
      <dc:date>2017-04-19T00:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/222202#M7018</link>
      <description>&lt;P&gt;I tried adding the permissions and pretty much everything described on the "How To" tutorial, however still am not able to get beyond the 403 error. The code works fine in &lt;A href="http://docs.powerbi.apiary.io" target="_blank"&gt;http://docs.powerbi.apiary.io&lt;/A&gt; but I am unable to make it work through code &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; For authentication our app uses the approach where it does not require the user to approve the access permissions in the pop up mentioned above. Do we have to enable it for PowerBI to work?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 13:33:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/222202#M7018</guid>
      <dc:creator>khurram75</dc:creator>
      <dc:date>2017-07-31T13:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/231393#M7294</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm aslo facing same issue. Any solution to this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 06:26:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/231393#M7294</guid>
      <dc:creator>wakhan07</dc:creator>
      <dc:date>2017-08-15T06:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/232627#M7332</link>
      <description>&lt;P&gt;modifying the authentication to prompt for credentials allowed me to get past the 'Forbidden' error...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return ac.AcquireTokenAsync(resourceUriPowerBi, clientId, new Uri(RedirectURL), new PlatformParameters(PromptBehavior.Auto)).Result.AccessToken;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 17:10:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/232627#M7332</guid>
      <dc:creator>erikskov</dc:creator>
      <dc:date>2017-08-16T17:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error occured when using REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/234656#M7395</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://community.powerbi.com/t5/forums/replypage/board-id/Developer/message-id/7332" target="_blank"&gt;&lt;SPAN&gt;@erikskov&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your kind reply,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't see forbidden error anymore. However, we have WebAPI's returning token and we don’t want to get the popup at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I set the prompt behavior to "NEVER" I get below error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"user_interaction_required: One of two conditions was encountered: 1. The PromptBehavior.Never flag was passed, but the constraint could not be honored, because user interaction was required. 2. An error occurred during a silent web authentication that prevented the http authentication flow from completing in a short enough time frame"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And when I tried&amp;nbsp;Directly specifying the username and password, it never returns any result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;var authenticationResult = authenticationContext.AcquireTokenAsync(resourceUri, clientID, credential).Result;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this throws an error ""AADSTS75005: The request is not a valid SAML 2.0 protocol message."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I look forward for your reply,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your support.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Aug 2017 05:40:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-Forbidden-error-occured-when-using-REST-API/m-p/234656#M7395</guid>
      <dc:creator>wakhan07</dc:creator>
      <dc:date>2017-08-20T05:40:27Z</dc:date>
    </item>
  </channel>
</rss>

