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
Anonymous
Not applicable

Examples of WebMethod.Post(...)

Hi all,

I'm interested in updating data sources via a REST API based on information generated from a report, but I'm struggling to understand how to use the WebMethod.Post(...) function. There's no documentation that explains this API or provides an example on how it can be used. Can anyone provide some insight on how to make POST calls within Power BI?

Thanks in advance!
Martin

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Anonymous wrote:

Hi all,

I'm interested in updating data sources via a REST API based on information generated from a report, but I'm struggling to understand how to use the WebMethod.Post(...) function. There's no documentation that explains this API or provides an example on how it can be used. Can anyone provide some insight on how to make POST calls within Power BI?

Thanks in advance!
Martin


@Anonymous

May I know why you'd like to send POST request in Power BI? Usually to get data, it is to call a GET request. Anyway, you can try

below sample which calls the POST API of streaming dataset.

 

let
     
    url = "https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/29f1e104-5e56-4247-8712-8f109102109f/rows?key=cZs8uA30GFpBHTi8bCSEbt2RK6fZn3QuZDnp6pgsyk1JofKe49WjSXxbBiMlqb1NXjkCb5sSHeNS52GFIxbCnA%3D%3D",
    body = "
[
{
""VALUE"" :198.6
}
]
",
    Source = Web.Contents(url,[Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(body)])
in
    Source

 

View solution in original post

5 REPLIES 5
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Anonymous wrote:

Hi all,

I'm interested in updating data sources via a REST API based on information generated from a report, but I'm struggling to understand how to use the WebMethod.Post(...) function. There's no documentation that explains this API or provides an example on how it can be used. Can anyone provide some insight on how to make POST calls within Power BI?

Thanks in advance!
Martin


@Anonymous

May I know why you'd like to send POST request in Power BI? Usually to get data, it is to call a GET request. Anyway, you can try

below sample which calls the POST API of streaming dataset.

 

let
     
    url = "https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/29f1e104-5e56-4247-8712-8f109102109f/rows?key=cZs8uA30GFpBHTi8bCSEbt2RK6fZn3QuZDnp6pgsyk1JofKe49WjSXxbBiMlqb1NXjkCb5sSHeNS52GFIxbCnA%3D%3D",
    body = "
[
{
""VALUE"" :198.6
}
]
",
    Source = Web.Contents(url,[Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(body)])
in
    Source

 

I am going to use the following to login to a web service to receive a session ID:

 

let
    url = "https://BASEURL:50000/b1s/v1/Login",
    headers = [#"Content-type"="application/json"],
    postData = Json.FromValue([CompanyDB = "ABC TEST", Password = "12345ABC", UserName = "[email protected]"]),
    response = Web.Contents(
                url, 
                [
                    Headers = headers,
                    Content = postData
                ]
                ),
            jsonResponse = Json.Document(response)
    in
        jsonResponse
Anonymous
Not applicable

Thanks Eric!

 

I didn't know I could also make POST calls using Web.Contents(...).

 

I'm experimenting with the idea of using Power BI to update issues in our JIRA instance. Perhaps not how Power BI was intended to be used, but it could prove very useful for our team.

Did you succeed at this? Could you please link me if you've shared your method as I would be interested. Thank you 🙂

Anonymous
Not applicable

Bump!

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.

60 days of Data Days Carousel

Data Days 2026

Join Fabric 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.