Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ALean
Frequent Visitor

Simple API authenticated with bearer token not working in Power BI, but is in Postman

I wish to consume a simple API which is only authenticated with a bearer token.

This works perfectly when done in Postman.

 

I cannot figure out why Power BI cannot authenticate it.
Anonymous: "We couldn't authenticate with the credentials provided. Please try again"
Web API: "A web API key can only be specified when a web API key name is provided."


_PBI_Obscured_API.png

 Figure: API Url with Authoirzation token reflecting the working version in Postman

 

I have also attempted to do this using the advanced editor from a blank query and still cannot authenticate.

 

let
     apiUrl = "https://api.**********/2.0/items",
     options = [Headers=[#"Authorization"="Bearer *************************************************"]],
     result = Web.Contents(apiUrl , options)
in
     result

 

2 REPLIES 2
Anonymous
Not applicable

@ALean,

Please check the following similar blog about how to connect to web API with bearer token.

https://chris.koester.io/index.php/2015/07/16/get-data-from-twitter-api-with-power-query/

Regards,
Lydia

Thanks for the link  v-yuezhe-msft.
That didn't work though.

The code on that blog is just a more complicated version of what I'm doing.
Since my bearer token is static, I don't need to request it dynamically everytime.
That blog outlines it as fundamentally being "table = Web.Contents(apiUrl , options)"

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.