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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
natolira
Frequent Visitor

Power query using post method with windows authentication

Hello. I have a macro that extract some content form an intranet, but I´m having trouble to implement the same solution using M.

 

The part of the vba code that matters is:

---------------------

Parameter = "MyParameter"
Url = "MyURL"

 

With CreateObject("MSXML2.XMLHTTP.6.0")
  .Open "POST", Url, False
  .setRequestHeader "User-Agent", "mozilla/4.0 (compatible; MSIE 6.0)"
  .setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"
  .send Parameter
  txt = .responsetext
End With
Set objXmlHttp = Nothing
text = Split(txt, Chr(10))

-----------

 

and then I have the data I need in txt format....

 

Anyone can help me to get the same data using Power Query?

5 REPLIES 5
YARGLTD
New Member

Hi, did you ever figure out how to POST data using Windows Credentials to an API?  GET seems to be supported but not POST.  Any help would be appreciated as it's driving me nuts!  Regards, Steve

v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@natolira,

Please take a look at the following similar thread to connect to your API using M language.

https://community.powerbi.com/t5/Integrations-with-Files-and/How-to-Authenticate-to-a-REST-API-with-...

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.

Lydia, thanks! I´m afraid tis link workd with basic authentication, not with windows authentication, which is my necessity.

@natolira,

You can directly add connection information in Advanced Editor to connect to your API. When using Windows credentials , please verify that you have been granted access with your own user/password combination. There are some samples for your reference.

https://jessedotnet.com/2016/06/24/power-bi-connect-to-your-secure-api/
http://angryanalyticsblog.azurewebsites.net/index.php/2016/05/16/api-strategies-with-power-bi/

Regards,

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.
natolira
Frequent Visitor

Hello. I have a macro that extract some content form an intranet, but I´m having trouble to implement the same solution using M.

 

The part of the vba code that matters is:

---------------------

Parameter = "MyParameter"
Url = "MyURL"

 

With CreateObject("MSXML2.XMLHTTP.6.0")
  .Open "POST", Url, False
  .setRequestHeader "User-Agent", "mozilla/4.0 (compatible; MSIE 6.0)"
  .setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"
  .send Parameter
  txt = .responsetext
End With
Set objXmlHttp = Nothing
text = Split(txt, Chr(10))

-----------

 

and then I have the data I need in txt format....

 

Anyone can help me to get the same data using Power Query?

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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