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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
BI
New Member

Get Data from Web API using HTTP Header

Hi,

 

I'm querying website WS.com (name anonymized) by sending an HTTP message with an additional header which contains the API key.

 

I'm using the Power BI formula

 

Web.Contents("https://WS.com/webapi/", [Headers=[#"API-Key"="asdf123"], Query = [#"v"="1.1", #"from"="0"]]) for this.

 

In Power BI Desktop I receive all my data without any complains. But when I upload the data model to powerbi.com and try to refresh the dataset there, Power BI complains that my login information is wrong.

 

Updatefehler.png

2 REPLIES 2
hammerblue
Helper I
Helper I

Hello, I'm having a different issue, but related I think. I'm using the same code as OP but I get the error "The '(header)' header is only supported when connecting anonymously". Removing the header containing the token returns another error that the GET method is not supported. I have no idea what I'm doing wrong, very new to API's. I can query a new token from the API in question through PBI, as well use the mock server they have. But can't connect using my own token

aldodfm
Frequent Visitor

Hello,

 

Indeed, i'm having the same issue, i don't know why.

 

Please, microsoft power bi team, could you fix this issue? Power Bi service make sense if we can schedule the refresh of this kind of webservice.

 

@BI did you find any solution for this?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.