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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Ballzer0
New Member

POST to Rest API while being authenticated with Organizational account

when i do a request like this

let
Kilde = Web.Contents("https://myAPI.com/that/requires/organizational/account", [Content=Text.ToBinary("json goes here")])
in
Kilde

 ill get an error saying i have to be connected anonimously to add content.

then i tried using WebAction.Request instead, but it just crashes with an unexpected error.

 

 


let
Kilde = WebAction.Request(WebMethod.Post, "https://myAPI.com/that/requires/organizational/account", [Content=Text.ToBinary("json goes here")])
in
Kilde

If anyone has any examples on how to use WebAction.Request, it would be highly appreaciated. or any other ways of sending a post request with some json to an API 

4 REPLIES 4
dax
Community Support
Community Support

Hi @Ballzer0 , 

When you use web connector to connect this datasource, you should choose corresponding authentication type when connecting(you could delete the permission from edit queries->datasource setting, then re-connect it and choose corresponding credential type).

Or you also could pass the auth-token in it. 

597.PNG

 You could refer to Working with Web Services in Power Query  for details.

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.

this datasource needs to log who uses it. so they would not be able to give me an authorization token. The system admin said its a NO-Go unless i have user auth.

Hey!

Your best course of action would be to create a Power BI Custom Connector. That would be the most ideal scenario.

Best!

DataChant
Post Prodigy
Post Prodigy

Hi @Ballzer0,

Do you need to login to your account via the browser in order to get access? This is not supported by Power Query. Ideally, you would have an access token that can be used inside Web.Contents. 

 

@miguel published a great blog post that explains it:

https://www.poweredsolutions.co/2017/01/24/connecting-to-apis-with-power-bi-power-query-part-1-of-2/

 

Hope it helps,

Gil

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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