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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Power Query - Blank Query - Key parameter missing

Hello,

 

I'm trying to pull some data from a url using Power Query and I can't seem to figure out how to do it. 

 

I have the follow code, but it returns a 400 ResponseCode and ResponseText "Key parameter missing."

 

 

let
    url = " https://website.com",
    body  = "{ ""Key"": ""apikey"",  ""Operation"": ""GetEntityTypes""}",
    Source = Json.Document(Web.Contents(url, [Headers=[#"Content-Type"="application/json"], Content=Text.ToBinary(body) ] ))
in
    Source

 

 

When I try this on Postman, it works when I enter the key-value information in form-data on the Body of the API request. I'm not sure how I can do that with power query. It's not passing my variable to the body of the powery query request for the server to read the key. The API documents indicates that it doesn't require any additional authorization. All requests need to be post requests.

 

Thanks,

 

3 REPLIES 3
lbendlin
Super User
Super User

Follow example 2 for the recommended approach

Web.Contents - PowerQuery M | Microsoft Learn

Anonymous
Not applicable

Thank you, but I tried it and it still returns that the Key parameter is missing. Here is my code. Do you see anything wrong?

let
    url = "https://website.com",
    headers = [#"Content-Type" = "application/json"],
    postData = Json.FromValue([Key = "api_key",  Operation = "GetEntityTypes"]),
    response = Web.Contents(
        url,
        [
            Headers = headers,
            Content = postData
        ]
    ),
    jsonResponse = Json.Document(response)
in
    jsonResponse

 

Nothing obvious stands out .  You say it works in Postman. Maybe you can use a network sniffer to compare the packets generated by Postman and by Power Query?

Helpful resources

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

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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