Forum Discussion
Unable to call Rest API
Hi Anonymous ,
have you copied the query over from PBI Desktop or could it be that you have a typo in row 8:
acessAuth instead of accessAuth?
Otherwise: Any more hints if you click on "Show Details" in the error-message?
- Anonymous2 years agoNot applicable
Hi ImkeF
I am using pwerbi cloud - i.e, https://app.powerbi.com/ ,
The query is working fine on the desktop app, but when I try to call the service from power bi cloud, Looks like its unable to make the call to the rest api for generating the token's.
Below is the query i am try to hit.
let
Url = "https://api.apm****.com",
credentials =
[
client_id = "E5eUI7PBFfVLuKrJHhyw**",
client_secret = "Iu3Ih9eQ**"
],
acessAuth =
Json.Document(Web.Contents(
Url,
[
RelativePath = "oauth/client_credential/accesstoken",
Query =
[
grant_type = "client_credentials"
],
Headers =
[
#"Content-Type"= "application/x-www-form-urlencoded"
],
Content = Text.ToBinary(Uri.BuildQueryString(credentials))
]
)
),
token = acessAuth[access_token]
in
token