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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sugna66
Frequent Visitor

First Data Connector Rest API

Hello, I am new to the world of Power Query and M... Power BI for that matter. 

 

I am trying to create a data connector to our REST API and running into some difficulty. 

 

When I login authenticating via UsernamePassword I get a table back with my hash token in the second column, fifth row down.

 

The table columns are Name, Value and the row is Name = hash and Value = "sdda009dwdeweassdsdsas" (for example). 

 

I am trying to add that hash back into my table request as follows. I apologize in advance for what you're about to see as this is my first day in power query: 

 

let

Credential = Extension.CurrentCredential(),

CredentialConnectionString = [ UID = Credential[Username], PWD = Credential[Password] ],


source = Web.Contents(url & "/api/login/" & CredentialConnectionString[UID] & "/" & CredentialConnectionString[PWD], [ Headers = DefaultRequestHeaders ]),
hashrow = source{5},
hash = hashrow{1},
report = Web.Contents(url & "/api/report/1/output/Reports/Sugna66/test_test?auth=" & [hash], [ Headers = DefaultRequestHeaders ]),
json = Json.Document(report)
in
source;

 

As you can see I don't really understand the table calls yet. Any help with this would be appreciated. 

 

Cheers,

 

 

 

 

1 ACCEPTED SOLUTION

Thanks, 

 

eventually, I figured it out: 

 

SynDNAImpl = (url as text) =>

let
Credential = Extension.CurrentCredential(),

CredentialConnectionString = [ UID = Credential[Username], PWD = Credential[Password] ],

login = Record.ToTable(Json.Document(Web.Contents(url & "/api/login/" & CredentialConnectionString[UID] & "/" & CredentialConnectionString[PWD], [ Headers = DefaultRequestHeaders ]))),
FilterLogin = Table.SelectRows(login, each _[Name] = "hash" ),
hash = List.First(Table.Column(FilterLogin, "Value")),
source = Web.Contents(url & "/api/report/1/output/Reports/Angus/test_test?auth=" & hash, [ Headers = DefaultRequestHeaders ]),
json = Json.Document(source)

in
json;

 

It seems like much but it worked for logging in grabbing a report. 

View solution in original post

3 REPLIES 3
sugna66
Frequent Visitor

Bump? Any love here? 

@sugna66 ,

What data format and fields would your REST API return? Power BI Desktop returns all the data the REST API provides.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, 

 

eventually, I figured it out: 

 

SynDNAImpl = (url as text) =>

let
Credential = Extension.CurrentCredential(),

CredentialConnectionString = [ UID = Credential[Username], PWD = Credential[Password] ],

login = Record.ToTable(Json.Document(Web.Contents(url & "/api/login/" & CredentialConnectionString[UID] & "/" & CredentialConnectionString[PWD], [ Headers = DefaultRequestHeaders ]))),
FilterLogin = Table.SelectRows(login, each _[Name] = "hash" ),
hash = List.First(Table.Column(FilterLogin, "Value")),
source = Web.Contents(url & "/api/report/1/output/Reports/Angus/test_test?auth=" & hash, [ Headers = DefaultRequestHeaders ]),
json = Json.Document(source)

in
json;

 

It seems like much but it worked for logging in grabbing a report. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.