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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Refreshing Bearing Token

I'm attempting to create a system that will pull data from an API that requires a token. While I was figuring everything else out I was just requestion the authorization in a query and then copy and pasting the response. I will have 15-20 different queries all that will need the token on a daily basis.

 

Can someone direct me to someplace that would show me how to;

1) Query for the authorization and then just use that query in the other queries

2) A way to refresh the token on a daily basis automatically.

 

Any help would be appreciated.

 

Thank You,

3 REPLIES 3
lbendlin
Super User
Super User

1. Handling authentication for Power Query connectors - Power Query | Microsoft Learn

2. What for? Your query can run for a maximum of five hours before it gets cancelled by the Power BI service.  

Anonymous
Not applicable

1. I already have the authentication. I did that in a seperate Query because it requires connecting to a different endpoint of the same API then the endpoint I'm pulling the data from. What I'm trying to figure out is how to get that token into the authentication of other queries. Seems like it should be simple because I have the information from the authorization in a table. I *think* I should be able to just say something like "Authorization = Name of the field the token is in"

 

2. I'm doing this in Excel and will be pulling the data from Excel into another program. It will not be a continuous run but I planned on using the "Refresh Query" property. The token expires every 2-3 days. 

Slightly different format

 

"Authorization= Bearer " & token

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors