Forum Discussion
ericOnline
5 years agoPost Patron
URL, Scope and Grant_type to use when creating a PBI REST API access_token?
Hello, I have an app registered within Azure. I'm able to make a token request to login.microsoft.com and get a successful response and receive an access_token. However, when I try to use thi...
ericOnline
5 years agoPost Patron
I was able to dig through some Python examples to get more info (!) but still no success.
Here is where I am:
- Header: "Content-Type": "application/x-www-form-urlencoded"
- Body: grant_type=client_credentials&client_id=<client_id here>&client_secret=<URL_Encoded Client_secret here>&scope=https://analysis.windows.net/powerbi/api/.default
- Response: Status 200
{
"token_type": "Bearer",
"expires_in": 3599,
"ext_expires_in": 3599,
"access_token": "eyJ0e..."
}
However, when I try to use this token to access the PBI REST API, I get the following errors:
- Headers:
{
"Content-Type": "application/json",
"Authorization": "Bearer <token from above response>"
}
- Body:
{
"format": "PNG"
}
- Response: Status 404; Not found
{
"statusCode": 404,
"headers": {
"Date": "Mon, 01 Mar 2021 19:05:07 GMT",
"Content-Length": "0"
}
}
What is missing here?