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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Krijgerss
New Member

Need help to connect to a appi with a appi key

hello i want to connect to a appi by the way of the advance editor within the powerquery i used this code

Krijgerss_0-1699004807553.png

now if i want to connect i get the datasource error : " web.contents with the option content only support anomeus " what do i need to change in my code so i can connect to the api the Api has a API TOKEN so i need to put a api key in the M-code


many thanks

1 REPLY 1
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @Krijgerss - it is difficult to help.  Have you tried testing this API call in Postman?

 

My gut instinct is that you need to include the API key in the Header.   It is similar to the approach described here: Accessing REST APIs with Basic Auth and API Key in Power Query | John Dalesandro

 

Consider moving it from the Web.Content step to the options step, where you have added Content Type. 

options = 
[
   #"Content-Type" = "abc",
   "ApiKeyName" = "xyz"
]

 

If your API Key has been added into the Connection Credential.  It will need to be deleted and replaced with "Anonymous" setting like this instead on being included in the "Web API" panel.

DarylLynchBzy_0-1699033206652.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors