<?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: Attempt to get list of Workspaces via REST API results in 401 Unauthorized. in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1992666#M30869</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check whether you have grant admin consent in your API Permission.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 993px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/565216i51F6743FEEDDF1C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 998px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/565217i198C1BEC5E655563/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here are two posts with similar errors like yours.&lt;/P&gt;
&lt;P&gt;For reference:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-Service/m-p/627827" target="_self"&gt;&lt;SPAN&gt;Power Bi REST API - 401 Authorization error when using Service Principals&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588468" target="_self"&gt;&lt;SPAN&gt;Power Bi REST API - 401 Authorization error when using app secret&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2021 09:51:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-08-02T09:51:56Z</dc:date>
    <item>
      <title>Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1983183#M30763</link>
      <description>&lt;P&gt;I'm currently using the REST API to list Datasets. This is working just fine. Now, I want to get a list of Workspaces (that my user has access to). To do this, I'm using the call here:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/groups/get-groups" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/groups/get-groups&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is, I get this error: "The remote server returned an error: (401) Unauthorized."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I went into Azure and updated the permissions for my app to include:&amp;nbsp;&lt;SPAN&gt;Workspace.ReadWrite.All&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...but still no dice. I'm using the same code to get my auth header that I use when getting a list of Datasets. Everything else is the same code as well. The only thing I'm changing is the URL for the API call. What else do I need to do to enable this?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 22:04:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1983183#M30763</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-27T22:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985086#M30778</link>
      <description>&lt;P&gt;Shared capacity or Premium?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 15:00:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985086#M30778</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-07-28T15:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985091#M30779</link>
      <description>&lt;P&gt;Shared.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 15:02:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985091#M30779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T15:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985142#M30780</link>
      <description>&lt;P&gt;I think the call you are referencing is only applicable to Premium environments.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 15:29:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985142#M30780</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-07-28T15:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985252#M30782</link>
      <description>&lt;P&gt;Is there any way to confirm this? I don't see it mentioned in the docs I linked to. I'd like to make sure it's a limitation before I abandon this.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 16:29:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1985252#M30782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T16:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1992666#M30869</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check whether you have grant admin consent in your API Permission.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 993px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/565216i51F6743FEEDDF1C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 998px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/565217i198C1BEC5E655563/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here are two posts with similar errors like yours.&lt;/P&gt;
&lt;P&gt;For reference:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-Service/m-p/627827" target="_self"&gt;&lt;SPAN&gt;Power Bi REST API - 401 Authorization error when using Service Principals&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588468" target="_self"&gt;&lt;SPAN&gt;Power Bi REST API - 401 Authorization error when using app secret&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 09:51:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1992666#M30869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-02T09:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1993302#M30875</link>
      <description>&lt;P&gt;That "Grant admin consent for..." checkbox is grayed out on my screen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I looked at those other posts, but they're for Tenant access, not Workspace access, and I don't even follow what they mean about a "Service Principle". I'd need more detail to even try to implement those solutions.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 14:45:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1993302#M30875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-02T14:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1994538#M30883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you see green icon "Granted for ..." on the right side of "Workspace..." as below? If you couldn't see green icon, the admin hasn't grant consent for it.&amp;nbsp;That "Grant admin consent for..." checkbox is grayed out on your screen. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please refer to blog as below for more details about&amp;nbsp;"Grant admin consent for..."&amp;nbsp; function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For reference:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/configure-admin-consent-workflow#enable-the-admin-consent-workflow" target="_self"&gt;Enable the admin consent workflow&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 818px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/565729iA02982EAFD8CF78A/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 06:20:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1994538#M30883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-03T06:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1995980#M30899</link>
      <description>&lt;P&gt;I don't quite follow. The "&lt;SPAN class="azc-grid-headerlabel azc-grid-headerCell"&gt;Admin consent required" field says "No", just like it does for &lt;SPAN&gt;Dataset.ReadWrite.All (which is working just fine)&lt;/SPAN&gt;. Why would I need admin consent for Workspace when it says I don't need it, and when Dataset also says I don't need it (and it's working)?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 18:28:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1995980#M30899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-03T18:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1996000#M30900</link>
      <description>&lt;P&gt;Also, I tried that link you posted, but I don't have rights to those options, so they're all grayed out.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 18:39:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1996000#M30900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-03T18:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1997303#M30911</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;App owns data (Service principal) doesn't need you to add api permission.&lt;/P&gt;
&lt;P&gt;What kind of App did you register in Azure Portal, app owns data (master user) or user owns data?&lt;/P&gt;
&lt;P&gt;Please check your app, and the parameter you use in request body.&lt;/P&gt;
&lt;P&gt;For reference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/register-app?tabs=organization%2CAzure" target="_self"&gt;Register an Azure AD application to use with Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here I found some post with&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-Service/m-p/627827" target="_self"&gt;Power Bi REST API - 401 Authorization error when using Service Principals&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588468" target="_self"&gt;Power Bi REST API - 401 Authorization error when using app secret&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 08:39:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/1997303#M30911</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-04T08:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2002760#M30957</link>
      <description>&lt;P&gt;I'm not sure what you mean by this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"App owns data (Service principal) doesn't need you to add api permission. What kind of App did you register in Azure Portal, app owns data (master user) or user owns data? Please check your app, and the parameter you use in request body."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I registered my app already and it has been working just fine for years. It is only now that I'm trying to pull a list of Workspaces via the API that it's giving me the unauthorized error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, as I mentioned above, I have already looked at those posts and they do not address my issue. I'm not pulling Tenant info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you need some kind of special permissions to be able to access Workspace level classes, but if that's the case, I don't know where to go to get that permission.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 16:15:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2002760#M30957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-06T16:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003000#M30961</link>
      <description>&lt;P&gt;In the error response, did you get a message about performing an "interactive" request for admin consent?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 19:17:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003000#M30961</guid>
      <dc:creator>msalerno</dc:creator>
      <dc:date>2021-08-06T19:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003014#M30962</link>
      <description>&lt;P&gt;No. The entire message I get is:&amp;nbsp;"The remote server returned an error: (401) Unauthorized."&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 19:20:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003014#M30962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-06T19:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003025#M30963</link>
      <description>&lt;P&gt;Ok.&amp;nbsp; When you added the new Scope to you app, perhaps it is not Admin Consented to the User that you are trying to use.&amp;nbsp; Try this...&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Azure Active Directory&lt;/P&gt;&lt;P&gt;- Go to Users, Select your user&lt;/P&gt;&lt;P&gt;- Click Applications on the Left&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Click the Application in the list that has the new Scope you just added&lt;/P&gt;&lt;P&gt;- You will see an Assignment Detail screen... at the bottom, click View Granted Permissions&lt;/P&gt;&lt;P&gt;- You will see a Permissions &amp;amp; Content screen... Search the list to make sure the new scope is in the list granted to your user.&amp;nbsp; If not, add it now and try again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 19:32:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003025#M30963</guid>
      <dc:creator>msalerno</dc:creator>
      <dc:date>2021-08-06T19:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003115#M30966</link>
      <description>&lt;P&gt;I think we're getting somewhere, but I still can't fix it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I click on View Granted Permissions I see a big button that says "Grant Admin consent for [My Company]" which, if I'm reading the description correctly, grants access to that app for all users, not just a specific user. So I don't want that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then below that I see a couple tabs: Admin consent and User constent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Admin tab is empty (no permissions have been granted by an admin), but when I go to the User consent tab, I see permissions granted to that user, but I only see "Read and write all datasets". I don't see "Read and write all Workspaces" even though I've added that permission to the app. And there's no "Add" button anywhere I can see to add new permissions. Isn't that permission added at the app level?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 21:13:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2003115#M30966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-06T21:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2033385#M31286</link>
      <description>&lt;P&gt;Finally found an answer to this (exceptionally poorly documented) process. See below.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 21:31:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2033385#M31286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-23T21:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to get list of Workspaces via REST API results in 401 Unauthorized.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2033393#M31287</link>
      <description>&lt;P&gt;I finally found the answer to this issue and wanted to document it here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that you don't need to just add API Permissions to an App Registration. You need to also consent to each API Permission (scope) at a user or app level. Now, an admin can grant access for all users (which is what is mentioned by some answers here in this post), but I'm not an admin, so I couldn't do that. What I needed to do was consent as a user to the specific API permissions that I had added to my App Registration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I couldn't find a way to do this in the Azure AD interface. In fact, I only found one place anywhere that actually explained how to do this for a *user* (the admin-level consent was mentioned in numerous places). Here is an answer here which talks about the URL needed to grant user consent to an API permission:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/59282141/aadsts65001-the-user-or-administrator-has-not-consented-to-use-the-application" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/59282141/aadsts65001-the-user-or-administrator-has-not-consented-to-use-the-application&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The URLs look like so:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;A href="https://login.microsoftonline.com/[Put" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/[Put&lt;/A&gt; your Tenant ID here]/oauth2/v2.0/authorize?
client_id=[This is your Client ID from your App Registration]
&amp;amp;response_type=code
&amp;amp;redirect_uri=https://myapp.mycompany.com[This must be the Redirect URI you setup in your App Registration]
&amp;amp;response_mode=query
&amp;amp;scope=https://graph.microsoft.com/User.Read[This&amp;nbsp;is&amp;nbsp;the&amp;nbsp;scope&amp;nbsp;URL for&amp;nbsp;the&amp;nbsp;API Permission]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I (finally) found that example, I was able to piece together a URL to consent to the newly added Workspace API permissions and my code started working. You can find out the "scope" URL for each API permission (which you have to add to the end of the full URL above) by going to your App Registration and clicking on API Permissions and then clicking on any of the API permissions you've added. This will bring up a window which shows the URL for that API Permission.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 20:58:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Attempt-to-get-list-of-Workspaces-via-REST-API-results-in-401/m-p/2033393#M31287</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-04T20:58:07Z</dc:date>
    </item>
  </channel>
</rss>

