<?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 message while trying to hit PBI API (I am able to get the token) in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2605731#M37026</link>
    <description>&lt;P&gt;1. Did you manage to make any other calls to PowerBI with the specified App&amp;nbsp;&amp;nbsp;&lt;BR /&gt;For example try to call&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/groups/create-group" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/groups/create-group&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;If not that could indicate some miss configuration os your app or the aquired token&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;2. Try to enable the Profiles feature to the entire org and see if that solve the problem&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mshmordok_0-1656396951446.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/739335iC9514EEC170A6588/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mshmordok_0-1656396951446.png" alt="mshmordok_0-1656396951446.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. If issue still not resolved then add the requestId from the Create Profile API 403 reponse to this thread so we can try track the failure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2022 06:17:57 GMT</pubDate>
    <dc:creator>mshmordok</dc:creator>
    <dc:date>2022-06-28T06:17:57Z</dc:date>
    <item>
      <title>403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2604974#M37018</link>
      <description>&lt;P&gt;Hi All!&lt;/P&gt;&lt;P&gt;I am tryng to user the new service proncipal profile feature in order to publish datasets on multiple tenents using PBI API.&lt;/P&gt;&lt;P&gt;I created an app registration, Azure AD group for the service principal and enabled all the relevat settings on the PBI servce.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to get the service principal access token, but when I trying to use in order to ge t create a new profile I am getting a 403 error.&lt;/P&gt;&lt;P&gt;I have using the trial PPU&amp;nbsp;license.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching the request that I am sending to the API&lt;/P&gt;&lt;P&gt;(using python)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;token = GetServicePrincipalToken(APIParam['TenantID'],APIParam['ClientID'],APIParam['ClientSecret'])
api_url = "https://api.powerbi.com/v1.0/myorg/profiles"
headers = {"Authorization": f"Bearer {token}"}

payload = {"displayName": "My First Profile"}

response = requests.request("POST",api_url, json=payload, headers=headers)
#response = json.loads(response.text)
print(response)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I repreformed the entire procees of creating the Azure app registration, AD groups setting PBI service and took screenshot sthrought the entre prcess.&lt;/P&gt;&lt;P&gt;I used 2 guides: &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-multi-tenancy" target="_blank" rel="noopener"&gt;The full and official Microsoft guide on this link&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the &lt;A href="https://www.youtube.com/watch?v=1SO19uik1rw&amp;amp;t=197s" target="_blank" rel="noopener"&gt;Youtube video on guy in a cube "Service principal 101"&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to&amp;nbsp;&lt;A href="https://docs.google.com/document/d/1MMZTKwGCk1yRRezKvpvS8iHHWwPrNBSl11FWvGhKvdE/edit#heading=h.kh0klmkn36kk" target="_self"&gt;Screenshot that I took throguht the entire proccess&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appriciate the help, Tal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 21:48:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2604974#M37018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-27T21:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2605731#M37026</link>
      <description>&lt;P&gt;1. Did you manage to make any other calls to PowerBI with the specified App&amp;nbsp;&amp;nbsp;&lt;BR /&gt;For example try to call&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/groups/create-group" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/groups/create-group&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;If not that could indicate some miss configuration os your app or the aquired token&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;2. Try to enable the Profiles feature to the entire org and see if that solve the problem&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mshmordok_0-1656396951446.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/739335iC9514EEC170A6588/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mshmordok_0-1656396951446.png" alt="mshmordok_0-1656396951446.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. If issue still not resolved then add the requestId from the Create Profile API 403 reponse to this thread so we can try track the failure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 06:17:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2605731#M37026</guid>
      <dc:creator>mshmordok</dc:creator>
      <dc:date>2022-06-28T06:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2607879#M37062</link>
      <description>&lt;P&gt;Hi! Thanks for the response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first, I want to check. Can I use the Service principal and the API with PPU or do I need premium capacity?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I turned all 3 settings to "The entire organization"&lt;/P&gt;&lt;P&gt;I send the request below and got the 403. I also tried using postman&lt;/P&gt;&lt;P&gt;Request ID:&amp;nbsp;&lt;SPAN&gt;88398de2-d060-4b65-997d-a821d44f36c4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(got the ID from Postman, not using the code below)&lt;/SPAN&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
import json
from config import APIParam
from GetServicePrincipalToken import GetServicePrincipalToken




token = GetServicePrincipalToken(APIParam['TenantID'],APIParam['ClientID'],APIParam['ClientSecret'])
api_url = "https://api.powerbi.com/v1.0/myorg/groups?workspaceV2=True"
headers = {"Authorization": f"Bearer {token}"}

payload = {"name": "Sample workspace V2"}

response = requests.request("POST",api_url, json=payload, headers=headers)
#response = json.loads(response.text)
print(response)&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 20:45:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2607879#M37062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-28T20:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2608342#M37066</link>
      <description>&lt;P&gt;The AAD token you are generating in&lt;/P&gt;&lt;PRE&gt;GetServicePrincipalToken&lt;/PRE&gt;&lt;P&gt;is not set with the right audience&amp;nbsp;&lt;BR /&gt;make sure the token you are using is with the right audience for powerbi API's "&lt;A href="https://analysis.windows.net/powerbi/api" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 05:31:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2608342#M37066</guid>
      <dc:creator>mshmordok</dc:creator>
      <dc:date>2022-06-29T05:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2608457#M37068</link>
      <description>&lt;P&gt;Thank you! can you please refer me to the the documantion which explain how to generate the token usingthe https you mentioned?&lt;/P&gt;&lt;P&gt;Thank you, Tal&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 06:32:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2608457#M37068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-29T06:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2608486#M37070</link>
      <description>&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/REST-API-Get-Access-Token/m-p/1895937#:~:text=Every%20portal%20has%20its%20url,or%20your%20account%20and%20password" target="_blank"&gt;https://community.powerbi.com/t5/Developer/REST-API-Get-Access-Token/m-p/1895937#:~:text=Every%20portal%20has%20its%20url,or%20your%20account%20and%20password&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 06:48:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2608486#M37070</guid>
      <dc:creator>mshmordok</dc:creator>
      <dc:date>2022-06-29T06:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2851395#M39331</link>
      <description>&lt;P&gt;To get the access token for service principal profile, you have to use the following endpoint:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/" target="_self"&gt;https://login.microsoftonline.com/&amp;lt;&amp;lt;tenant_id&amp;gt;&amp;gt;/oauth2/token&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following 4 parameters should be passed to the body:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;grant_type = client_credentials&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;client_id = Application (client) ID&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;client_secret = client secret value from Azure app&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;resource =&amp;nbsp;&lt;A href="https://analysis.windows.net/powerbi/api" target="_blank"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Sample request from postman:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-10-19 181640.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/806884i5A63B97302996BBF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-10-19 181640.png" alt="Screenshot 2022-10-19 181640.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:17:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/2851395#M39331</guid>
      <dc:creator>waqas_ahmed</dc:creator>
      <dc:date>2022-10-19T13:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: 403 error message while trying to hit PBI API (I am able to get the token)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/4747832#M62046</link>
      <description>&lt;P&gt;Hi, I am using Power BI trial account. Using service principal to get the token to access power BI apis. I get the token and when I access the API&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/datasets," target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/datasets,&lt;/A&gt;&amp;nbsp;I get the error&amp;nbsp;{&lt;BR /&gt;"Message": "API is not accessible for application"&lt;BR /&gt;} with 403 error. Can you please help me on this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2025 05:45:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/403-error-message-while-trying-to-hit-PBI-API-I-am-able-to-get/m-p/4747832#M62046</guid>
      <dc:creator>Swetha__Balusam</dc:creator>
      <dc:date>2025-06-30T05:45:54Z</dc:date>
    </item>
  </channel>
</rss>

