<?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 error on API calls with Power BI REST API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296728#M25253</link>
    <description>&lt;P&gt;Thanks for the response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the GenericProvider:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/GenericProvider.php" target="_blank"&gt;https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/GenericProvider.php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you sure the Resource URI is necessary? It's not used in the "user owns data" example so it's a bit confusing to me&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 15:20:46 GMT</pubDate>
    <dc:creator>dpm</dc:creator>
    <dc:date>2020-08-14T15:20:46Z</dc:date>
    <item>
      <title>403 error on API calls with Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296119#M25246</link>
      <description>&lt;P&gt;Hi, I've already seen a couple of posts about this topic but none of the proposed solutions seem to solve the issue for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whenever I make a call to&amp;nbsp;&lt;A href="https://api.powerbi.com/v1.0/myorg/reports" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/reports&lt;/A&gt;&amp;nbsp;I get a 403 error even though it works on the "Try it" page in the documentation (&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/reports/getreports#code-try-0" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/reports/getreports#code-try-0&lt;/A&gt;).&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Results in postman:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Naamloos.png" style="width: 800px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/333273iF42C88F2461411EE/image-dimensions/800x429?v=v2" width="800" height="429" role="button" title="Naamloos.png" alt="Naamloos.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code for receiving the access token:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Naamloos3.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/333285iE09174890C1A7CCD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Naamloos3.png" alt="Naamloos3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Configured permissions in azure&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Naamloos4.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/333287iE459DF7165D051E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Naamloos4.png" alt="Naamloos4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help regarding this issue would be greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 10:45:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296119#M25246</guid>
      <dc:creator>dpm</dc:creator>
      <dc:date>2020-08-14T10:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error on API calls with Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296535#M25250</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/252666"&gt;@dpm&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am not familiar with the generic-provider object that you have used in your code examples... but one thing does look like it might be missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am guessing that the 403 (Forbidden) rather than a 401 (Unauthorized) is due to your token being genuine, but you might be missing the target &lt;STRONG&gt;Resource URI&lt;/STRONG&gt; that you want to access with your token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the Power BI Rest API you will need to supply &lt;STRONG&gt;&lt;A href="https://analysis.windows.net/powerbi/api" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt; &lt;/STRONG&gt;as a Resource URI.&lt;BR /&gt;You can see this in use, within the C# auth example -&amp;gt; ClientID + Secret (Service Principal access)&amp;nbsp; &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/get-azuread-access-token#access-token-with-service-principal" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/get-azuread-access-token#access-token-with-service-principal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Service Principal access works differently to the standard user access - which is why you will be seeing different results in the 'Try It' part of the REST API documentation.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Cheers, Matt&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:44:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296535#M25250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-14T13:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error on API calls with Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296728#M25253</link>
      <description>&lt;P&gt;Thanks for the response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the GenericProvider:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/GenericProvider.php" target="_blank"&gt;https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/GenericProvider.php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you sure the Resource URI is necessary? It's not used in the "user owns data" example so it's a bit confusing to me&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 15:20:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296728#M25253</guid>
      <dc:creator>dpm</dc:creator>
      <dc:date>2020-08-14T15:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error on API calls with Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296825#M25255</link>
      <description>&lt;P&gt;Which method are you trying to use? App Owns Data or User Owns Data?&lt;BR /&gt;&lt;BR /&gt;From the authentication perspective these are 2 very different methods.&lt;BR /&gt;If you are doing the App Owns Data (using a master password or service principal account in Azure), then you need to specify the target resource that you are going to use the token with. (the resource uri).&lt;BR /&gt;&lt;BR /&gt;User Owns Data is different in that you would typically have a token from a users' logged in session - and use this when making API or embedding requests. The API/Service then authenticates against this token using the users' details.&lt;BR /&gt;&lt;BR /&gt;Looking at the library you are using... it looks as though it is designed for authenticating users against a 3rd party login (Facebook, Google, etc..) so I am not 100% sure if this is up to the job of fetching the correct tokens from Azure for the app owns data scenario. (Note: I dont code in php).&lt;BR /&gt;&lt;BR /&gt;I found this post that might help: &lt;A href="https://www.msbiblog.com/2018/01/12/power-bi-embedded-example-using-curl-and-php/" target="_blank"&gt;https://www.msbiblog.com/2018/01/12/power-bi-embedded-example-using-curl-and-php/&lt;/A&gt;&lt;BR /&gt;It shows an example for using a users credentials for accessing the REST API (notice the reference to the resource uri).&lt;BR /&gt;&lt;BR /&gt;This might be usable for both the App Owns Data &lt;U&gt;and&lt;/U&gt; User Owns Data - but the latter is probably only going to work with a master password scenario - some details on the differences between master password and service principal are here:&amp;nbsp; &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers#power-bi-username-and-password" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers#power-bi-username-and-password&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;if you can share more details about the method you are using (App/User) then I can try and find an example that works for you.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 15:54:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-on-API-calls-with-Power-BI-REST-API/m-p/1296825#M25255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-14T15:54:02Z</dc:date>
    </item>
  </channel>
</rss>

