Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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-yanjiang-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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.