Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Folks, I have an rest api post request services am calling into power bi using below code here am using the auth key as my authorization but this authkey is keep on changes instead of auth key i have to provide basic authenticaion is username and password(For example Username : sauser, Pwd: sauser123). Please help me to change the below code instead of Authkey to username and password in my power query.
let
url = "https://devdata.custmoer.abc/framework/login/authPost",
body = "{""userID"":""test"",""passwordEnc"":""66"",""AdditionalInfo"":{""appName"":""ABU CEP"",""appVersion"":""10"",""KVMap"":[{""key"":""Platform"",""value"":""Test""}]}}",
Parsed_JSON = Json.Document(body),
AuthKey = "Basic c29hdXNlcjpTMGFVJDNyMjU2NTY=)",
Source = Json.Document(Web.Contents(url,[ Headers = [#"Authorization"= AuthKey ,#"Content-Type"="application/json"], Content = Text.ToBinary(body) ] ))
in
Source
Solved! Go to Solution.
Hi @Anonymous ,
You can try like this:
[Headers =[#"Authorization"="Basic username:pasword"]]
Here is an examsple:
let
actualUrl = "URL",
options = [Headers =[#"Authorization"="Basic dXNlcm5hbWU6cGFzc3dvcmQ="]],
result = Json.Document(Web.Contents(actualUrl, options))
in
result
You can also refer the simliar thread:
Passing username and password in Basic authentication
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tank you all, i got my solution.
Hi @Anonymous ,
You can try like this:
[Headers =[#"Authorization"="Basic username:pasword"]]
Here is an examsple:
let
actualUrl = "URL",
options = [Headers =[#"Authorization"="Basic dXNlcm5hbWU6cGFzc3dvcmQ="]],
result = Json.Document(Web.Contents(actualUrl, options))
in
result
You can also refer the simliar thread:
Passing username and password in Basic authentication
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.