cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PritamKamthe
Frequent Visitor

How to connect the PowerBi with UIPath swagger Api

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

1 ACCEPTED 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"

 

View solution in original post

5 REPLIES 5
v-kalyj-msft
Community Support
Community Support

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"

 

RachelGomez1619
Helper II
Helper II

  1. Click Manage Packages then search for and install UiPath.Database.
  2. Activities. Navigate to the Activities and drop a Flowchart (Workflow -> Flowchart -> Flowchart) onto the process.
  3. Drop a database Connect activity (App Integration -> Datbase -> Connect) after the Start activity.
  4. Double-click the Connect activity and configure the Connection.

This may help you,

Rachel Gomez

PritamKamthe
Frequent Visitor

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.

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors