Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am trying to use a GET API that has a query parameter & json body content needed for the GET request. I am getting a 405 error. Any help is appreciated
let
url = "",
body = "",
response = Web.Contents(url,
[
Headers=[#"Content-Type"="application/json", #"Accept"="*/*"],
Content = Text.ToBinary(body),
Query = reportFormat = "csv"
]
),
Source = Csv.Document(response)
in
Source
Hi @userabd1234 ,
The 405 error generally occurs because the request method is not allowed. If content exists, change the request method to POST and pass JSON data in the request body. To use a GET request, attach the parameters to the end of the URL using the symbol ? to append the parameters to the end of the URL.
Here's the relevant link: Web.Contents - PowerQuery M | Microsoft Learn
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
I can't change the API to post, and the JSON body cannot live within the URL. Is there not a way to call a GET API that requires a JSON body within powerbi? I've read other situations where using web contents with content automatically turns the call into a POST. How do you get around this limitation if you have a GET API with a json body?
User | Count |
---|---|
84 | |
78 | |
70 | |
47 | |
42 |
User | Count |
---|---|
106 | |
50 | |
49 | |
40 | |
40 |