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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
rflea97
New Member

How to loop a refresh_token call?

Hi everyone!

I am trying to make an API call in Power Query, for which I need an access_token. This is the script I use to get this access_token: 

 

API AccessToken.png

 

 

 

 

 

 

 

 

 

 

 

 

The response from the script is an access_token, which expires in 10 minutes, and a refresh_token. I can use the refresh_token to make another call, for another access_token. I enter my initial refresh_token in the script above. But I am looking for a way that the next time the script refreshes, it uses the refresh_token from the previous call. Because the refresh_token is no longer valid after calling once.

 

I have looked into storing the called refresh_token into a parameter, but could not figure it out. Anyone knows how to fix my problem? Many thanks in advance!

1 REPLY 1
Mahesh0016
Super User
Super User

@rflea97 my suggestion is, you should try a custom connector and refresh your access token using API with a timestamp. Thank You!!

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.