Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I have not used PBI to perfom API calls in a while and things have certainly changed. I have looked around the internet and have found loads of suggestions but most don't understand the difference between a Token and a Key. Postman works fine.
With that, could I please acquire the updated and supported, simple and exact, Power Query syntax to pull API json data with a TOKEN, NOT a KEY. This seems simple enough but the syntax and requirements have changed and I am time constrained.
Thanks for your help!
TS
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.
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.