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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Passing parameter in Text.ToBinary

I am attempting to hand this report off to a client. I am connecting to their API via my developer credentials. I want to create a parameter so that when they open the report they have to enter their credentials to access the API. I have passed a paramter for the original API link. But I am unable to pass a parameter for where I normally enter my username and password within the query. What are my options? I have bolded the problem areas

 

 

let
GetAuth = Web.Contents(#"API",
[
Headers = [#"Accept"="application/json",
#"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"],
Content = Text.ToBinary("username=#"User Name"&password=#"Password"&grant_type=password")
]),
FormatAuthAsJson = Json.Document(GetAuth),
access_token = FormatAuthAsJson[access_token],
ReportData = Json.Document(Web.Contents(#"API2",
[

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

AFAIK, there are lots of methods to verify credentials, they can be attached to the header, contents(your method), query with different authorizations modes. (basic name/password or encrypted tokens and API keys...)
I'd like to suggest you contact the API developers to confirm what type of authorizations they used.

BTW, please also check the encoding of binary text if they work on the API, the basic base64 encode may not suitable with all scenarios.

Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

@ImkeF @edhans 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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