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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
mike_940
New Member

Authentication with API (one or two header values)

Hi!

 

In Power BI Desktop, I successfully connected to a Web API from which I retrieve JSONS. Authentication requires either one header value "X-Authorization" in the form of "[username]|[API Key]" or two header values "X-Account-Name" and "X-API-Key". Both methods work fine in Power BI Desktop and other tools.

 

After publishing to Power BI Service however, I am not able to connect to the data source to refresh the data set.

 

If I use the "X-Authorization" method, I receive an error telling me this method only works with the "anonymous" authentication.

 

let
Quelle = Json.Document(Web.Contents("https://XXX.XXX.com/~XX/XX/XX/further_parameters", [Headers=[#"X-Authorization"="XXX@XX.com|XXXXXXXXXXXXXXXXXXXX"]])),
#"In Tabelle konvertiert" = Table.FromList(Quelle, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
...

 

If I use both header values "X-Account-Name" and "X-API-Key", I receive an error that "at least one data source is missing credentials".

 

let
vUrl = "https://XXX.XXX.com/~XX/XX/XX/further_parameters",
vHeaders = [#"X-API-Key"="XXXXXXXXXXXXXXXXXXXX", #"X-Account-Name"="XXX@XX.com"],
Source = Web.Contents(vUrl, [Headers=vHeaders]),
Json = Json.Document(Source),
#"In Tabelle konvertiert" = Table.FromList(Json, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
...

 

Thank you in advance.

 

Best regards

0 REPLIES 0

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.