Access token obtained doesn't authorize calls on Power BI API
<p>I'm trying to use the Power BI REST API to embed some reports on my site. To do this using an access token acquired by &quot;client credentials&quot; method, but all the requests I'm doing the API denies by 403 codes.</p>
<p>I'm using PHP with curl, but to make it more readable I'll provide samples using curl client.</p>
<ul>
<li><p>Get Access Token Code:</p>
<p>curl -X POST  &quot;Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW&quot; -F &quot;client_id=4dd507e4-XXXX-XXX-8410-ce6853edf48a&quot; -F &quot;client_secret=i/0YIhvBa(...)/Y%3D&quot; -F &quot;grant_type=client_credentials&quot; &quot;https://login.microsoftonline.com/$myorg/oauth2/token&quot;</p>
</li>
<li><p>API Call (Get Reports for example):</p>
<p>curl -X GET -H &quot;Authorization: Bearer eyJ0eXAiOiJKV1QiLC(...)4QzVw&quot; &quot;Cache-Control: no-cache&quot; &quot;https://api.powerbi.com/v1.0/myorg/reports&quot;</p>
</li>
</ul>
<p>It should follow this flow:</p>
<pre><code>+---------+                                  +---------------+
:         :                                  :               :
:         :&gt;-- A - Client Authentication ---&gt;: Authorization :
: Client  :                                  :     Server    :
:         :&lt;-- B ---- Access Token ---------&lt;:               :
:         :                                  :               :
+---------+                                  +---------------+
</code></pre>
<p>PS:
I found a <a href="https://stackoverflow.com/questions/32341877/cant-get-client-credentials-access-token-to-authorize-power-bi">similar question</a> but this one isn't on same scope, language and append username and password isn't an option because isn't a personal application.</p>
<p>Attachement:
<a href="https://powerbi.microsoft.com/en-us/documentation/" rel="nofollow noreferrer">https://powerbi.microsoft.com/en-us/documentation/</a></p>