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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
KoenV3
Regular Visitor

Trying to recreate POST request in PowerQuery

Hi All,

Hope you can help me with the following. I've got an Endpoint that I'm trying to get data from but the only allowed method is POST on this endpoint. So I'm trying to find a way to get the data in PowerBI. 
I've got the post working in Postman:

 

 

curl --location '{BaseURL goes here}/Appointments/Get' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {Token goes here}' \
--data '{
  "StartDate": "2020-09-25",
  "EndDate": "2028-09-25",
  "Resources": [
46
  ]
}'

 

 

 
But if I try to rebuild this in power query it fails. I'm using following Query:

 

 

let

   URL = Text.Combine({baseURL,"/Appointments/Get"}),
   body = "{
  ""StartDate"": ""2020-09-25"",
  ""EndDate"": ""2028-09-25"",
  ""Resources"": ""[""
     46
     ""]""
}",
   Source=Json.Document(Web.Contents(URL,
   [
       Headers = [#"Authorizaion"="Bearer "&token,
       #"Content-Type"="application/json"],
       Content=Text.ToBinary(body)
]
))
in
Source

 

 

I keep getting a (500) Internal Server Error message. Any thoughts? 



1 REPLY 1
lbendlin
Super User
Super User

Try using Json.FromValue

 

Web.Contents - PowerQuery M | Microsoft Learn

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.