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
sajohnson05
Frequent Visitor

How to add credentials for Web API

I'm trying to set up a connection to a Web REST API in Power BI Service. I've attempted to use the API key in the username field under Basic Authentication, but I keep getting an error that all fields need to be filled out. Has anyone encountered this issue before, or does anyone have suggestions on how to properly configure this? Any help would be appreciated.

sajohnson05_0-1731421719611.png

 

 

2 REPLIES 2
Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @sajohnson05,

 

Can you try the below API key approach from the Web.Contents documentation? The Power Query M code is:

Web.Contents("https://contoso.com/api/customers/get", [ApiKeyName="api_key"])

 

https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-3

 



Happy to help out 🙂

I share #PowerAutomate and #SharePointOnline content on my Blog, Bluesky profile or Youtube Channel

@ExpiscornovusI'm able to get the API connection to work in the Desktop version of Power BI. However, when I try to update the data source credentials in the Power BI Service, I'm encountering issues. Any advice on how to resolve this?

sajohnson05_0-1731423682157.png

 

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 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.