I'm trying to connect to swagger ui-path api but getting error as
"We couldn't authenticate with the credentials provided"
I have used the api url and Authorization key also
Solved! Go to Solution.
Yes i got the solution.
follow below m code:
below power query
let
Source = Json.Document(Web.Contents("url", [Headers=[Authorization="Bearer " & "apikey"]])),
#"Converted to Table" = Table.FromRecords({Source}),
in
#"Converted to Table"
and for dynamic token generation follow below m code:
let
url = "apilink",
headers = [#"Content-Type" = "application/json"],
postData = Json.FromValue([tenancyName="*****",usernameOrEmailAddress="*****",password="*****"]),
response = Web.Contents(
url,
[
Headers = headers,
Content = postData
]
),
jsonResponse = Json.Document(response),
#"Converted to Table" = Record.ToTable(jsonResponse),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each ([Name] = "result")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Value"}),
#"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Value", type text}})
in
#"Changed Type"
Hi @PritamKamthe ,
Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team _ kalyj
Yes i got the solution.
follow below m code:
below power query
let
Source = Json.Document(Web.Contents("url", [Headers=[Authorization="Bearer " & "apikey"]])),
#"Converted to Table" = Table.FromRecords({Source}),
in
#"Converted to Table"
and for dynamic token generation follow below m code:
let
url = "apilink",
headers = [#"Content-Type" = "application/json"],
postData = Json.FromValue([tenancyName="*****",usernameOrEmailAddress="*****",password="*****"]),
response = Web.Contents(
url,
[
Headers = headers,
Content = postData
]
),
jsonResponse = Json.Document(response),
#"Converted to Table" = Record.ToTable(jsonResponse),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each ([Name] = "result")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Value"}),
#"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Value", type text}})
in
#"Changed Type"
This may help you,
Rachel Gomez
Thanks @amitchandak i'm able to connect by using
below power query
let
Source = Json.Document(Web.Contents("url", [Headers=[Authorization="Bearer " & "apikey"]])),
#"Converted to Table" = Table.FromRecords({Source}),
in
#"Converted to Table"
Now I want to get the api-key from the swagger uipath dynamically and stored into a function also it will be the post method, do you have any ideas.
@PritamKamthe , refer if this can help
https://docs.microsoft.com/en-us/power-query/handlingauthentication
if needed
https://community.powerbi.com/t5/Developer/Rest-API-Authentication-API-Key/m-p/1314965
User | Count |
---|---|
223 | |
81 | |
75 | |
73 | |
53 |
User | Count |
---|---|
185 | |
93 | |
83 | |
75 | |
74 |