Forum Discussion
Passing Variables in API Post Request JSON Body
- 8 years ago
Ok. I figured it out. I had to use an annoying text combination:
let LOGIN = Text.Combine({"""",Login_Parameter,""""},""), PW = Text.Combine({"""",Login_Password,""""},""), body = "{ ""UserName"":"&LOGIN&", ""Password"":"&PW&" }",Just to reiterate, the parameters I setup are named Login_Parameter and Login_Password and formatted as Text. The result comes out as:
body = { "UserName":"breticious", "Password":"password123" }
Breticious,
What Power Query code do you use to connect to the API in Power BI Desktop? I am not very sure about the requirement that " want to replace the [username parameter] and [password parameter] with the value in the parameter ". Could you please explain it?
Regards,
Lydia
Sorry for the late response, Anonymous but I'm not sure I follow what you are asking.
I am using Mashup in the Advanced Editor of Power BI to directly connect to a RESTFUL API that uses JSON objects to pass things back and forth. It requires an authentication token.
It was a giant pain in the rear and took a LOT of work to pass everything just right. Does that answer your question?