Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I'm not a developper at all more than a newbie, just scripting some very simple things sometimes.
As I have time right now I try to play with API of my company Contact Center software to generate some reports.
I succeed to call API from Postman and import JSON into Powerquery now I'd like PowerQuery to directly call the API. I tried a lot of different things but till now I did not succeed.
Maybe someone coudl help me "translate" this cURL into M language ?
curl --location --request POST 'https://website.domain/api/call/in/histories' \
--header 'Authorization: Basic authkey \
--header 'Content-Type: application/json' \
--data-raw '{
"startDate": "2020-03-01 00:00:00",
"endDate": "2020-03-24 23:59:59"
}'
Thans a lot for your help
Jérôme
I will be able to answer to this question since I had a similiar requirement and i was able to connect pull data successfully.
scripts you need to execute:
let
body = Json.Document("{
""startDate"": ""2020-03-01 00:00:00"",
""endDate"": ""2020-03-24 23:59:59""
}"),
response = Web.Contents("https://website.domain/api/call/in/histories", [Headers=[#"X-API-KEY"="paste your x-api-key here", #"Content-Type"="application/json", Cookie="paste your cookie here it is optional if not available remove this"],Content=Json.FromValue(body)]),
jsonResponse = Json.Document(response),
records = jsonResponse[records]
in
records
Hope this helps. Please accept it as a solution if it helped. If not provide your queries if will try to help you solve it
Hi Jerome, I am having the same identical issue than yours, did you solve it? If yes can you tell me how? Regards, Alessandro
I think this post may be able to help you with what you are trying to accomplish: https://eriksvensen.wordpress.com/2014/09/15/specifying-json-query-in-power-query-example-statistics...
Good luck,
I've already read this post but I'll drill a little more.
Thanks,
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 17 | |
| 9 | |
| 9 | |
| 7 | |
| 7 |