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
yebenesPW
Frequent Visitor

Parameters URL in API rest call

Hello everyone

 

I have some data that i get from a API call, name, id, domain... and i need take that id and call to another API. Im following that video https://www.thebiccountant.com/2018/03/22/web-scraping-2-scrape-multiple-pages-power-bi-power-query/

thats how my query looks 

 

 

 

 

let
content = "{
""method"": ""post"",
""body"": {}
}",
Origen = Json.Document(Web.Contents("https://website/data/730214/runs/3246632/", [Headers=[#"content-type"="application/json", Authorization="Bearer ZnIzY3UzM2w1YXQ2ZDM0Mm9nMWxkYWRta2dtYTI0aWNtaDdmMmZvYTNiZ3E0MzVjbGhiZ3ZrczBuMCYzNzI5NCYxNjYwMjA1MDM5Nzc0"], Content=Text.ToBinary(content)],
[Query = "website/data/" & main_id &"/runs/" & lastrun_id ])),
#"Convertido en tabla" = Record.ToTable(Origen)
in
#"Convertido en tabla"

 

 

 

 

When i try to do that i get the next error

 

 

 

Expression.Error: Se han pasado 3 argumentos a una función que espera entre 1 y 2.
Detalles:
    Pattern=
    Arguments=[List]

 

 

 

 

How can i solve it?

 

Thanks u

1 REPLY 1
ImkeF
Community Champion
Community Champion

Hi @yebenesPW ,
you need to include the Query as another record field in the first record. So removing some brackets should do the job here:

let
content = "{
""method"": ""post"",
""body"": {}
}",
Origen = Json.Document(Web.Contents("https://website/data/730214/runs/3246632/", [Headers=[#"content-type"="application/json", Authorization="Bearer ZnIzY3UzM2w1YXQ2ZDM0Mm9nMWxkYWRta2dtYTI0aWNtaDdmMmZvYTNiZ3E0MzVjbGhiZ3ZrczBuMCYzNzI5NCYxNjYwMjA1MDM5Nzc0"], Content=Text.ToBinary(content), Query = "website/data/" & main_id &"/runs/" & lastrun_id ])),
#"Convertido en tabla" = Record.ToTable(Origen)
in
#"Convertido en tabla"



Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

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