Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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,
Follow example 2 for the recommended approach
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?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 33 | |
| 32 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 64 | |
| 44 | |
| 30 | |
| 28 |