Forum Discussion
Amar-Agnihotri
Resolver I
4 years agoWe found extra characters at the end of JSON input
I have created a function in power query to get the authorization code which i will use to generate the access token to call the REST api. Here is the function definition - () => let body = "...
ImkeF
Community Champion
4 years agoHi Amar-Agnihotri ,
I would try to call the API whithout instantly trying to convert the result to JSON like so:
let
body = "client_id=021ed4a0-7883-42fd-82c0-0566481cc851&response_type=code&redirect_uri=http://localhost:44300/&response_mode=query&scope=openid&state=12345",
Data= Web.Contents("https://login.microsoftonline.com/common/oauth2/authorize/",
[Headers=[#"Content-Type"="application/x-www-form-urlencoded"],
Content=Text.ToBinary(body)
])
in
Data
This will allow you to check the format of the API return.
BTW: Your response parameter in the header suggests that you are getting a query back. That could explain the mismatch.
- Amar-Agnihotri4 years ago
Resolver I
hi ImkeF
I changed the code as you can see
But when i am invoking the function it is returning this -
I think this makes no sense .. No data ios returned
- ImkeF4 years ago
Community Champion
Yes, that's looking good.
Now, just click or doublecklick on the globe-symbol and the content should automatically extract further.- Amar-Agnihotri4 years ago
Resolver I