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
Markzolotoy
Impactful Individual
Impactful Individual

Trying to get data from api

Here is my code:  It is POST.

 

 

 

 

let
url = "https://localhost:446/token",
body = "{""grant_type"":""password"",
""username"":""domain\username"",
""client_id"":""xxxxxxx""
}",
Source = Json.Document(Web.Contents(url, [Headers=[#"Content-Type"="application/x-www-form-urlencoded"],
Content = Text.ToBinary(body)
]))

in
#"Source"

 

 

 

 

I am getting:

Query1
Web.Contents failed to get contents from 'https://localhost:446/token' (400): Bad Request
 
Need to provide more details. In order to get this token a user needs to be authenticated first using Windows Authentication. If I try changing permissions to Windows then I get:
Web.Contents with the Content option is only supported when connecting anonymously.
 
Thanks
 

 

2 REPLIES 2
Markzolotoy
Impactful Individual
Impactful Individual

@amitchandak Not helping.

amitchandak
Super User
Super User

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.