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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

Custom API keeps asking for authentication

I have an API using the following M query to implement an authentication using headers, api key & token.

// Define the API URL for data retrieval
apiUrl = "",

// Define headers with x-api-key and x-token
headers = [
#"x-api-key" = "your_api_key_value",
#"x-token" = "your_token"

// Make the GET request with headers
response = Web.Contents(apiUrl, [Headers=headers]),
jsonResponse = Json.Document(response)

And I want to authenticate anonimously because I user headers and I can not. It keeps asking for authentication. My API also connects with a username and password or with API key. But none of them seem to work. It always keep asking for authentication.

Any clue on the issue or hint for the approach?
Thank you.


Community Support
Community Support

Hi @nf_protogramma ,

Base on your description, it sounds like you're trying to make a web request in Power Query (M language) and encountering issues with the authentication prompt. Please try to set Anonymous authentication and check if it can resolve the problem:

  • Go to 'File' > 'Options and settings' > 'Data Source Settings'
  • Find the data source (your API URL) and select it
  • Click on 'Clear Permissions'
  • Try to reconnect and, when prompted, choose 'Anonymous' accessvyiruanmsft_0-1719217559256.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.