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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

requests to a JWT API token

Hello I need to get the jwt token to access an API, my request does not work

 

My code :

let

 

GetJson = Web.Contents("https://xxxxxxxxxxxxxx",
[
Headers = [#"Accept"="application/json",
#"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"],
Content = Text.ToBinary("username=xxxxxx&password=xxxxxxxx")
]
),
FormatAsJson = Json.Document(GetJson),
#"Converted to Table" = Record.ToTable(FormatAsJson),
access_token = #"Converted to Table"{0}[Value]
in
access_token

 

power Bi return an error 404.

 

If I try with postman, I have no problem

 

curl --location --request POST 'https:xxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "xxxxxxxxxx",
"password": "xxxxxxxxx"
}'

 

Can anyone help me ?

3 REPLIES 3
dax
Community Support
Community Support

Hi @Anonymous , 

Did you directly add credential in header? If you pass credential by authentication window(after you click "connect", the authentication window will prompt), will it work? You also could try to use Fiddler to find the detailed error information

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi

 

my request works with the following code :

 

 

let
url = "https://xxxxxxxx",
body = "{ ""username"": ""xxxxxxxxxxx"", ""password"": ""xxxx""}",
Parsed_JSON = Json.Document(body),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
token = Json.Document(Web.Contents(url,[Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(body) ] )),
#"Converti en table" = Record.ToTable(token)
in
#"Converti en table"

Just wanted to say thank you. Your post gave me the help I needed to solve my own similar JWT authentication issue

https://community.powerbi.com/t5/Power-Query/Assistance-with-converting-CURL-request-into-PowerQuery...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors