<?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 Power BI REST API, HTTP 401 in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4129463#M55070</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to successfully test connectivity of my App registration using the codebase, against the default `&lt;SPAN&gt;&lt;A href="https://graph.microsoft.com/" target="_blank" rel="noopener"&gt;https://graph.microsoft.com/&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;v1.0/users`&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Azure-Samples/ms-identity-javascript-nodejs-console" target="_blank" rel="noopener"&gt;Azure-Samples/ms-identity-javascript-nodejs-console: A Node.js console daemon application secured by MSAL Node and calling Microsoft Graph API via OAuth 2.0 client credentials flow (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When attempting to test against the Power BI endpoints, I get a HTTP 401&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a quick test, I made the following changes on the codebase, to file `./bin/auth.js:21`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;tokenRequest&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;scopes&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;apiConfig&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;uri&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;'&lt;A href="https://api.powerbi.com/v1.0/myorg/groups" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/groups&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;```&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;API permissions on the app&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The delegated permissions will be removed, as we will be building a Node-based daemon - we added the only `ReadWrite` permission that was displayed for Power BI, for application permissions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-02 at 12.13.09.png" style="width: 887px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1160827iDC1FA242AEA021A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-02 at 12.13.09.png" alt="Screenshot 2024-09-02 at 12.13.09.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate any help or suggestions; as it's looking as if this setup isn't possible? Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2024 11:29:25 GMT</pubDate>
    <dc:creator>op-agw</dc:creator>
    <dc:date>2024-09-02T11:29:25Z</dc:date>
    <item>
      <title>Power BI REST API, HTTP 401</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4129463#M55070</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to successfully test connectivity of my App registration using the codebase, against the default `&lt;SPAN&gt;&lt;A href="https://graph.microsoft.com/" target="_blank" rel="noopener"&gt;https://graph.microsoft.com/&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;v1.0/users`&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Azure-Samples/ms-identity-javascript-nodejs-console" target="_blank" rel="noopener"&gt;Azure-Samples/ms-identity-javascript-nodejs-console: A Node.js console daemon application secured by MSAL Node and calling Microsoft Graph API via OAuth 2.0 client credentials flow (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When attempting to test against the Power BI endpoints, I get a HTTP 401&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a quick test, I made the following changes on the codebase, to file `./bin/auth.js:21`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;tokenRequest&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;scopes&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;apiConfig&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;uri&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;'&lt;A href="https://api.powerbi.com/v1.0/myorg/groups" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/groups&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;```&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;API permissions on the app&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The delegated permissions will be removed, as we will be building a Node-based daemon - we added the only `ReadWrite` permission that was displayed for Power BI, for application permissions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-02 at 12.13.09.png" style="width: 887px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1160827iDC1FA242AEA021A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-02 at 12.13.09.png" alt="Screenshot 2024-09-02 at 12.13.09.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate any help or suggestions; as it's looking as if this setup isn't possible? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 11:29:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4129463#M55070</guid>
      <dc:creator>op-agw</dc:creator>
      <dc:date>2024-09-02T11:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI REST API, HTTP 401</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4129482#M55072</link>
      <description>&lt;P&gt;Power BI REST API, HTTP 401&lt;/P&gt;&lt;P&gt;16m ago&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to successfully test connectivity of my App registration using the codebase, against the default `&lt;A href="https://graph.microsoft.com/v1.0/users" target="_blank"&gt;https://graph.microsoft.com/v1.0/users&lt;/A&gt;`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Azure-Samples/ms-identity-javascript-nodejs-console: A Node.js console daemon application secured by...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When attempting to test against the Power BI endpoints, I get a HTTP 401&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a quick test, I made the following changes on the codebase, to file `./bin/auth.js:21`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const tokenRequest = {&lt;/P&gt;&lt;P&gt;scopes: ['&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;'],&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const apiConfig = {&lt;/P&gt;&lt;P&gt;uri: '&lt;A href="https://api.powerbi.com/v1.0/myorg/groups" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups&lt;/A&gt;',&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;API permissions on the app&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The delegated permissions will be removed, as we will be building a Node-based daemon - we added the only `ReadWrite` permission that was displayed for Power BI, for application permissions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Screenshot 2024-09-02 at 12.13.09.png&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate any help or suggestions; as it's looking as if this setup isn't possible? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 11:50:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4129482#M55072</guid>
      <dc:creator>Tayyabali</dc:creator>
      <dc:date>2024-09-02T11:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI REST API, HTTP 401</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4130878#M55084</link>
      <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from Tayyabali&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Hi, &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/792737"&gt;@op-agw&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;HTTP 401 errors typically indicate authentication issues. Here are some possible workarounds:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;1.First, check the access token: Make sure your application provided a valid access token in the request. The access token may be missing, invalid, or expired.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Here is a screenshot of the relevant documentation:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vlinyulumsft_0-1725354763924.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1161322i3F6AFC6FC5D9422F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vlinyulumsft_0-1725354763924.png" alt="vlinyulumsft_0-1725354763924.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="https://learn.microsoft.com/en-us/graph/resolve-auth-errors" target="_blank"&gt;&lt;SPAN&gt;Resolve Microsoft Graph authorization errors - Microsoft Graph | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;2.Second, confirm that the permissions are sufficient: Make sure that you have assigned the correct API permissions to your application in the Azure portal and that they have been granted by the administrator.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vlinyulumsft_1-1725354763931.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1161323i24C58A2AA2F3BD25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vlinyulumsft_1-1725354763931.png" alt="vlinyulumsft_1-1725354763931.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;3.Next, m&lt;/SPAN&gt;&lt;SPAN&gt;ake sure the Power BI service admin permissions are turned on&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vlinyulumsft_2-1725354823507.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1161324iF2CC6D5F6F34D5A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vlinyulumsft_2-1725354823507.png" alt="vlinyulumsft_2-1725354823507.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;4.Finally, debug tokens: Use a tool such as JWT.io to decode your access token, checking the permissions and expiration date in it&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;A href="https://www.bing.com/search?q=JWT&amp;amp;form=ANNH01&amp;amp;refig=8661f8975dce4c1cb424494de4564ef1&amp;amp;pc=U531" target="_blank"&gt;&lt;SPAN&gt;https://www.bing.com/search?q=JWT&amp;amp;form=ANNH01&amp;amp;refig=8661f8975dce4c1cb424494de4564ef1&amp;amp;pc=U531&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Of course, if you have any new ideas, you are welcome to contact us.&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;SPAN&gt;helps&lt;/SPAN&gt;, then please consider Accept it &lt;SPAN&gt;as the solution &lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 09:14:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4130878#M55084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-03T09:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI REST API, HTTP 401</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4131187#M55086</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We just needed to enable the option "&lt;SPAN&gt;Service principals can use Fabric APIs&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;All now appears to be working, and receiving data responses!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For others finding this, and need details on the Power BI admin portal:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/fabric/admin/admin-center" target="_blank"&gt;What is the Microsoft Fabric admin portal? - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 11:59:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-HTTP-401/m-p/4131187#M55086</guid>
      <dc:creator>op-agw</dc:creator>
      <dc:date>2024-09-03T11:59:05Z</dc:date>
    </item>
  </channel>
</rss>

