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
Leecal123
New Member

On Premise Gateway invalid credentials

I'm currently connecting to a web data source using API Key passed as a header in my URL. Works fine in PowerBI desktop.

 

I'm trying to create scheduled refresh using personal gateway however am getting invalid credentials error.

 

Any idea's how to pass my API Key as part of the URL when adding my Web data source to gateway?

 

Thanks,

 

Lee

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Leecal123

First, it is no need to use a gateway when you data source is online as power bi service is a online service.

Just edit credentials for your data source, 

5.png

 

If this doesn't help, here is a similar issue regarding refreshing the data source in Power BI Service when passing parameter in URL, you may check the suggestions discussed under it.

 

Best Regards

Maggie

 

Hi Maggie, 

 

Have tried achanging credentials back to Anonymous (as it is in PowerBI desktop) but still the same error when refreshing.

 

Have read the forum in the link you've provided but is throwing error with datasource in my inital query now. My Query looks like this:

Json.Document(Web.Contents("https://APIURL/440701" & "/event.json" & "?EventTypeCode=N102" & "&FromDate=2018-01-01" & "&take=1000", [Headers=[#"x-ApiKey"="APIKEY"]]))

 

 

Hi @Leecal123

Which error does it throw?

Is something wrong with your code?

Regarding how to Specifying JSON Query in Power Query, please refer to the link.

Please go to data source setting->edit permission to see the type of credential.

 

Best Regards

maggie

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.