Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

API with dynamic access token can't refresh in Power BI service


I have a report needs to get data from a REST API. To access the API, I need to first generate a access token and the token will be expired every 1 hour. I've searched many materials and was able to write a power query in Power BI desktop to generate the dynamic token and then refresh the dataset. However, after publishing the report to Power BI service, it won't allow me to refresh the dataset by schedule. Some of the posts say that we need to build a custom connector to make it work in Power BI service. 

Does anyone has idea is there some other way to make it work?



Community Support
Community Support

Hi @emilyh ,

Please refer to the following documents to see if it helps you.


If it does not solve your problem, please provide a screenshot on it.


Best Regards

Community Support Team _ Polly


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

Hi @v-polly-msft ,

I tried the solution you provided from the links, but did not work for my scenario. I need to access to a API with a dynamic access token which need to be refreshed every one hour. The access token is part of the header.

if I put the authorization part in a query, the authentication did not work.


it works using header, but it won't allow me to refresh in Power Bi service using this way.



Hi @v-polly-msft 

I have the same problem. Is there any solution for that?



Helpful resources

T-Shirt Design Challenge 2023

Power BI T-Shirt Design Challenge 2023

Submit your creative T-shirt design ideas starting March 7 through March 21, 2023.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors