Dear,
I have a Dataverse DataFlow that connects to a third party API, which uses simple authentication.
In the first part, I get the accesstoken by putting my email address and password in the body:
AccessToken = let
GetJson = Json.Document(Web.Contents("https://xxxxx.com/api/v2/users/me/login", [Headers=[Accept="application/json", #"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"], Content=Text.ToBinary("email=xxxxxxxxxx&password=xxxxxxxxxxx")])),
data = GetJson[data],
#"Converted to Table" = Record.ToTable(data),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each [Name] = "accessToken"),
Value = #"Filtered Rows"{0}[Value]
in Value
In the second part, I use the accesstoken to call an API request:
let
AccesTokenvalue = AccessToken,
Source = Json.Document(Web.Contents("https://xxxxxxxx.com/api/v2/getdata", [Headers=[Authorization="Bearer " & AccesTokenvalue]])),
data = Source[data]
in
data
in
data;
How can I convert this to a query where the credentials can be taken out of the query code, so that the password can remain hidden for users looking into the query?
Thanks,
Koen