Forum Discussion
Simple API JSON "GET" call with a TOKEN (I already have a token)
Hi Anonymous ,
Please try
let
token = "your_token_here",
url = "https://api.example.com/data",
options = [
Headers = [
#"Authorization" = "Bearer " & token
]
],
response = Web.Contents(url, options),
json = Json.Document(response)
in
json
Replace "your_token_here" with your actual token and "https://api.example.com/data" with the URL of the API endpoint you want to call. This code will send a GET request to the API endpoint with the token in the Authorization header and return the JSON response.
Please note that you may need to modify the options variable to include additional headers or query parameters depending on the API you are calling.
Similar post: Solved: How to pull data from Web API into PowerBI using A... - Microsoft Power BI Community
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous3 years agoNot applicable
Thanks so much for your response, Stephen.
What you shared should work but does not. I am not using any other Headers. Again, Postman works perfectly. I have two other API calls running to the same system but they don't require Tokens. I don't see any error messages and the only thing returned is the actual text in the API call.