Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi All,
I have a REST API that returns JSON formatted data.
Here's what's in Power Query Advanced Editor:
let
bodytext =
"{""StartDate"":""2018-01-01"",
""EndDate"":""2019-12-31""}",
url = "<removed>",
body = Json.FromValue(bodytext),
Source =
Json.Document(
(Web.Contents
(url
, [Headers=
[#"Content-Type"="application/json"
,Authorization="aaaaa"
, Key="1234"
, Value="1234"],
Content = body])))
in
Source
I'm getting a "(405): Method Not Allowed" back. I believe it's at the Content = body line.
Everything is working in PostMan. Authorization, Key, Value all are parameters, and I'm passing StartDate and EndDate in the body.
Appreciate any input, I've got about 5 hours into debugging... first time trying this here!
Solved! Go to Solution.
If you include the content parameter to web.contents, I believe it forces an HTTP POST method. Is this what you are expecting? Also, in my past experience I've always used Text.ToBinary where you are using Json.FromValue
If you include the content parameter to web.contents, I believe it forces an HTTP POST method. Is this what you are expecting? Also, in my past experience I've always used Text.ToBinary where you are using Json.FromValue
I Need To connect an API on power bi with the TOKEN and the Headers, someone can help me?
I think you're right about the post, will keep trying to debug it. Thanks!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 82 | |
| 48 | |
| 36 | |
| 31 | |
| 29 |