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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
gbros
New Member

Power BI - Need data from a POST Api

I am trying to get data forma an API with <post method from Power query but I cannot do it, and I don't find the error...here is my code:

gbros_0-1740151744751.png

 

There is some parts commented because I think the problem is how I send parameters...

 

La descripción de la API es la siguiente:

gbros_1-1740151906799.png

 

 

I hope someone can help me!!

 

THANK YOU

 

2 REPLIES 2
ZhangKun
Super User
Super User

Yes. You should try running the following two examples (check the "json" fields in the result to see if your program is correct). I believe you will truly understand how to post data.

 

let
    resp = Web.Contents(
        "https://httpbin.org", 
        [
            RelativePath = "post", 
            Content = Json.FromValue([A = 1, B = "2025/01/02"])
        ]
    ), 
    data = Json.Document(resp)
in
    data

 

let
    resp = Web.Contents(
        "https://httpbin.org", 
        [
            RelativePath = "post", 
            Content = Text.ToBinary("{""A"": 1, ""B"": ""2025/01/02""}", TextEncoding.Utf8)
        ]
    ), 
    data = Json.Document(resp)
in
    data
lbendlin
Super User
Super User

Please follow the documentation. Use a body payload. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-2

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors