<?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: URL, Scope and Grant_type to use when creating a PBI REST API access_token? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3171057#M42060</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/87233"&gt;@ericOnline&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Was&amp;nbsp; your issue ever resolved?&amp;nbsp; &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;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/182446"&gt;@V-lianl-msft&lt;/a&gt;&amp;nbsp; I have very similar issue&amp;nbsp; I have successfully brought back the token correctly now using a script provided by one of your team but I am now getting&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KarenL7_0-1680594547602.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/897103i5D1D4F6D25D08FAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KarenL7_0-1680594547602.png" alt="KarenL7_0-1680594547602.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The only thing I am missing in my script is "Scope" as I am unsure what to use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the post for reference&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Refreshable-Token-for-Admin-Rest-API/m-p/3152512#M1065083" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Refreshable-Token-for-Admin-Rest-API/m-p/3152512#M1065083&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the script I used from the above post&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;let //get token url = "&lt;A href="https://login.microsoftonline.com/xxxxxxx/oauth2/token" target="_blank"&gt;https://login.microsoftonline.com/xxxxxxx/oauth2/token&lt;/A&gt;", GetJson = Web.Contents( url, [ Headers = [ Accept = "application/json", ContentType = "application/x-www-form-urlencoded" ], Content = Text.ToBinary( "grant_type=client_credentials&amp;amp; client_id=xxxxxxx&amp;amp; client_secret=xxxxxxx&amp;amp; scope=xxxxxx" ) ] ), token = Json.Document(GetJson)[access_token], //other api usage wiht above token Result = Web.Contents( "&lt;A href="https://xxxxx.xxx.com" target="_blank"&gt;https://xxxxx.xxx.com&lt;/A&gt;", [ Headers = [ #"Content-Type" = "application/json", Authorization = "Bearer " + token, RelativePath = "/xxxxx/xxxxx" ] ] ) in Result&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do I need to add anything else to the script apart from the scope?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Karen&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2023 07:56:14 GMT</pubDate>
    <dc:creator>KarenL7</dc:creator>
    <dc:date>2023-04-04T07:56:14Z</dc:date>
    <item>
      <title>URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1690485#M28095</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an app registered within Azure. I'm able to &lt;A href="https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#first-case-access-token-request-with-a-shared-secret" target="_self"&gt;make a token request to login.microsoft.com and get a successful response&lt;/A&gt; and receive an access_token.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, when I try to use this access_token to access the PBI REST API, I get a Forbidden Status 403.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use an access_token based on my &lt;STRONG&gt;own&lt;/STRONG&gt; credentials, I can access the API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What is the correct URL, Scope and Grant_type to use when creating a PBI REST API access_token for a Service Principal?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 20:51:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1690485#M28095</guid>
      <dc:creator>ericOnline</dc:creator>
      <dc:date>2021-02-25T20:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1694840#M28129</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/87233"&gt;@ericOnline&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please refer to this thread:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-BI-REST-API-gives-403-error-User-does-not-have-access-to/m-p/607049" target="_self"&gt;https://community.powerbi.com/t5/Developer/Power-BI-REST-API-gives-403-error-User-does-not-have-access-to/m-p/607049&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Liang&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 02:22:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1694840#M28129</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2021-03-01T02:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1696693#M28143</link>
      <description>&lt;P&gt;Thanks for the response, however the Service Principal is listed as "Admin" in both the Workspace and Dataset. What I need is:&amp;nbsp;&lt;STRONG&gt;Which token URL, Grant_type and Scope to use when requesting a token based on Client_id and Client_secret.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 18:03:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1696693#M28143</guid>
      <dc:creator>ericOnline</dc:creator>
      <dc:date>2021-03-01T18:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1696824#M28144</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I&amp;nbsp;was&amp;nbsp;able&amp;nbsp;to&amp;nbsp;dig&amp;nbsp;through&amp;nbsp;&lt;A href="https://github.com/guyinacube/PowerBI-Developer-Samples/blob/master/Python/Embed%20for%20your%20customers/powerbiembedding/config.py" target="_self"&gt;some&amp;nbsp;Python&amp;nbsp;examples&lt;/A&gt;&amp;nbsp;to&amp;nbsp;get&amp;nbsp;more&amp;nbsp;info&amp;nbsp;(!)&amp;nbsp;but&amp;nbsp;still&amp;nbsp;no&amp;nbsp;success.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;Here&amp;nbsp;is&amp;nbsp;where&amp;nbsp;I&amp;nbsp;am:&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Token&amp;nbsp;server&amp;nbsp;URL:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://login.microsoftonline.com/" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;tenant_id&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;/oauth2/v2.0/token&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Header:&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;"Content-Type":&amp;nbsp;"application/x-www-form-urlencoded"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Body:&lt;/STRONG&gt;&amp;nbsp;grant_type=client_credentials&amp;amp;client_id=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;client_id&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;here&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;client_secret=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;URL_Encoded&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Client_secret&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;here&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;scope=&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;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Response:&lt;/STRONG&gt;&amp;nbsp;Status&amp;nbsp;200&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;"token_type":&amp;nbsp;"Bearer",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;"expires_in":&amp;nbsp;3599,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;"ext_expires_in":&amp;nbsp;3599,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;"access_token":&amp;nbsp;"eyJ0e..."&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;However,&amp;nbsp;when&amp;nbsp;I&amp;nbsp;try&amp;nbsp;to&amp;nbsp;use&amp;nbsp;this&amp;nbsp;token&amp;nbsp;to&amp;nbsp;access&amp;nbsp;the&amp;nbsp;PBI&amp;nbsp;REST&amp;nbsp;API,&amp;nbsp;I&amp;nbsp;get&amp;nbsp;the&amp;nbsp;following&amp;nbsp;errors:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Request&amp;nbsp;URL:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://api.powerbi.com/v1.0/reports/" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/reports/&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;report_id&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;here&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;/ExportTo&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Headers:&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;"Content-Type":&amp;nbsp;"application/json",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;"Authorization":&amp;nbsp;"Bearer&amp;nbsp;&amp;lt;token&amp;nbsp;from&amp;nbsp;above&amp;nbsp;response&amp;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;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Body:&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;"format":&amp;nbsp;"PNG"&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;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Response:&lt;/STRONG&gt;&amp;nbsp;Status&amp;nbsp;404;&amp;nbsp;Not&amp;nbsp;found&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"statusCode":&amp;nbsp;404,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"headers":&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Date":&amp;nbsp;"Mon,&amp;nbsp;01&amp;nbsp;Mar&amp;nbsp;2021&amp;nbsp;19:05:07&amp;nbsp;GMT",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Content-Length":&amp;nbsp;"0"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;What is missing here?&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Mar 2021 19:41:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/1696824#M28144</guid>
      <dc:creator>ericOnline</dc:creator>
      <dc:date>2021-03-01T19:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3002635#M40589</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/87233"&gt;@ericOnline&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyone, please help me with this, I've been stuck with the same error (403 forbidden).&amp;nbsp;&lt;SPAN&gt;I have an app registered within Azure and even I can get the access token, but when I use the token to retrieve the datasets from API, it shows the above 403 error.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 07:44:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3002635#M40589</guid>
      <dc:creator>Dayspring</dc:creator>
      <dc:date>2023-01-05T07:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3003023#M40592</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/494593"&gt;@Dayspring&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does your service principal have access to the workspace (through a security group or directly)?&lt;/P&gt;&lt;P&gt;Did you try to see the response body, sometimes it has additional info for the reason you get the error.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 10:26:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3003023#M40592</guid>
      <dc:creator>AmosHersch</dc:creator>
      <dc:date>2023-01-05T10:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3005032#M40610</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/278935"&gt;@AmosHersch&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to provide access to the workspace and also please provide the list of scopes that I should use while authenticating, as of now, I'm using the below scopes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;openid&lt;/P&gt;&lt;P&gt;offline_access&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 06:46:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3005032#M40610</guid>
      <dc:creator>Dayspring</dc:creator>
      <dc:date>2023-01-06T06:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3007306#M40627</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/494593"&gt;@Dayspring&lt;/a&gt;&amp;nbsp;each API has the list of required scopes, so it depends on which API you are using. You should follow the docs, for example:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/get-reports-in-group#required-scope" target="_blank"&gt;Reports - Get Reports In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For permissions you can either provide permissiong through Power BI portal as described here &lt;A href="https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-roles-new-workspaces" target="_blank"&gt;Roles in workspaces in Power BI - Power BI | Microsoft Learn&lt;/A&gt;&amp;nbsp;or use an API to provide permissions&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/groups/add-group-user" target="_blank"&gt;Groups - Add Group User - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2023 08:12:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3007306#M40627</guid>
      <dc:creator>AmosHersch</dc:creator>
      <dc:date>2023-01-08T08:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3171057#M42060</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/87233"&gt;@ericOnline&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Was&amp;nbsp; your issue ever resolved?&amp;nbsp; &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;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/182446"&gt;@V-lianl-msft&lt;/a&gt;&amp;nbsp; I have very similar issue&amp;nbsp; I have successfully brought back the token correctly now using a script provided by one of your team but I am now getting&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KarenL7_0-1680594547602.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/897103i5D1D4F6D25D08FAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KarenL7_0-1680594547602.png" alt="KarenL7_0-1680594547602.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The only thing I am missing in my script is "Scope" as I am unsure what to use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the post for reference&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Refreshable-Token-for-Admin-Rest-API/m-p/3152512#M1065083" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Refreshable-Token-for-Admin-Rest-API/m-p/3152512#M1065083&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the script I used from the above post&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;let //get token url = "&lt;A href="https://login.microsoftonline.com/xxxxxxx/oauth2/token" target="_blank"&gt;https://login.microsoftonline.com/xxxxxxx/oauth2/token&lt;/A&gt;", GetJson = Web.Contents( url, [ Headers = [ Accept = "application/json", ContentType = "application/x-www-form-urlencoded" ], Content = Text.ToBinary( "grant_type=client_credentials&amp;amp; client_id=xxxxxxx&amp;amp; client_secret=xxxxxxx&amp;amp; scope=xxxxxx" ) ] ), token = Json.Document(GetJson)[access_token], //other api usage wiht above token Result = Web.Contents( "&lt;A href="https://xxxxx.xxx.com" target="_blank"&gt;https://xxxxx.xxx.com&lt;/A&gt;", [ Headers = [ #"Content-Type" = "application/json", Authorization = "Bearer " + token, RelativePath = "/xxxxx/xxxxx" ] ] ) in Result&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do I need to add anything else to the script apart from the scope?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Karen&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 07:56:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3171057#M42060</guid>
      <dc:creator>KarenL7</dc:creator>
      <dc:date>2023-04-04T07:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3228124#M42599</link>
      <description>&lt;P&gt;I struggled for a few days with the forbidden (403) error and it turned out that I had the App registration correct. What I needed to do was to call the scope correctly in get_token. I was passing ".default" and then I read a thread where it recommended to change it to&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&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;". In one application what I wanted Dataset.ReadWrite.All, I sent the required scope as&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"&lt;A href="https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All&lt;/A&gt;". Apparently when you just send ".default" as scope Azure AD just looks for those scopes within Graph API. When you send the whole URL it gets you the right scope and my Forbidden error went away.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 May 2023 04:39:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3228124#M42599</guid>
      <dc:creator>bcoderra</dc:creator>
      <dc:date>2023-05-10T04:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: URL, Scope and Grant_type to use when creating a PBI REST API access_token?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3229119#M42607</link>
      <description>&lt;P&gt;Awesome, thank you! I can't find ANY documentation on the allowed scope values to send to&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A href="https://login.microsoftonline.com/xxxxxxx/oauth2/token" target="_blank" rel="nofollow noopener noreferrer"&gt;https://login.microsoftonline.com/xxxxxxx/oauth2/token&lt;/A&gt;&lt;SPAN&gt;".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 15:32:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/URL-Scope-and-Grant-type-to-use-when-creating-a-PBI-REST-API/m-p/3229119#M42607</guid>
      <dc:creator>ericOnline</dc:creator>
      <dc:date>2023-05-10T15:32:21Z</dc:date>
    </item>
  </channel>
</rss>

