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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lbonillab
Regular Visitor

API post data source params

I need to import data from API Post method, with body and I can't do it, could you help me?

 

let
Origen = Json.Document(Web.Contents("https://hst-api.wialon.com/wialon/ajax.html?svc=token/login", [Headers=[#"Content-Type"="application/x-www-form-urlencoded"]], [params={"token":"71406a685ac5fa696c7b3daefb1343b9FE88C2C627E3F9EF6A68E2FD49EA0836304BEA87","operateAs":"PB-Int"}],
#"Convertida en tabla" = Table.FromRecords({Origen}),
#"Tipo cambiado" = Table.TransformColumnTypes(#"Convertida en tabla",{{"error", Int64.Type}, {"reason", type text}})
in
#"Tipo cambiado"

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@lbonillab 
To add data source parameter in your URL, please check the following similar threads.

http://community.powerbi.com/t5/Desktop/Dynamic-connection-to-Web-URL/m-p/346607#M155589
https://community.powerbi.com/t5/Integrations-with-Files-and/Parameters-for-JSON-API-data-Maintain-Q...

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@lbonillab 
To add data source parameter in your URL, please check the following similar threads.

http://community.powerbi.com/t5/Desktop/Dynamic-connection-to-Web-URL/m-p/346607#M155589
https://community.powerbi.com/t5/Integrations-with-Files-and/Parameters-for-JSON-API-data-Maintain-Q...

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

lbonillab
Regular Visitor

And if I do the same query in "Rest Client", if I have the expected results.

Ehren
Microsoft Employee
Microsoft Employee

The M you shared above results in a syntax error (the json-style name/value pairs are not valid M).

lbonillab
Regular Visitor

The body of the query does not give me the expected results.

 

The error message is: "wrong params"

Ehren
Microsoft Employee
Microsoft Employee

Hi there. Can you clarify what isn't working?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors