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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
danielamengual
Frequent Visitor

Need to connect to API that requires OAuth2

Hi,

 

I'm trying to connect to write a query to connect to an API where I need to login and get a token, to then get access to the data. I'm not super familiar with M or with writing queries in general, I've mainly dealt with SQL connections and other simple connections that I've edited by transforming in Power Query. I connected to an API once, and it was through a url and key and that's it. 

 

From my research and multiple test runs that lead to nothing (i'm not crying, you are), is it necessary to create a custom connector, or is this something that can be done through a blank query? I'm not opposed to creating a connector, but before I go down that route, I want to know if it's absolutely necessary or if I'm overcomplicating this.

 

Any response is greatly appreciated !! 🙂

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @danielamengual 

You can try to refer to the following link to connect the api by OAuth2

powerbi - Private REST API connection Power BI (M - Power Query) - Stack Overflow

Chris Webb's BI Blog: Connecting To REST APIs With OAuth2 Authentication In Power Query/Power BI (cr...

But it better to use custom connector ,because when you write it directly by M, the safety will be affected. the following link is about use custom connector.

Power Query SDK overview - Power Query | Microsoft Learn

 

Best Regards!

Yolo Zhu

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

View solution in original post

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @danielamengual 

You can try to refer to the following link to connect the api by OAuth2

powerbi - Private REST API connection Power BI (M - Power Query) - Stack Overflow

Chris Webb's BI Blog: Connecting To REST APIs With OAuth2 Authentication In Power Query/Power BI (cr...

But it better to use custom connector ,because when you write it directly by M, the safety will be affected. the following link is about use custom connector.

Power Query SDK overview - Power Query | Microsoft Learn

 

Best Regards!

Yolo Zhu

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors