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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

REST API call from Power Automate

Hi

 

I am trying to run the following API calls in Power Automate to get the history, and refresh the datasets:

GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes

 

I can run a single call of POST, I get a status code of 202,  but if I try to run the same call in a loop I get a 401. The call is exactly the same other than there is a loop and the API is called multiple times.

 

You have to first get a token for the authorization, I have tried both a single call before the loop and within the loop, still the same error.

 

Any ideas please?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Grrrr, I am so annoyed, but also very happy.

 

I have found my error. Its not because of the loop, that was a red herring! What it was and the reason why it's so annoying is, as part of the http REST API call is your header. This has your autorization, to the left you have Bearer and your access_token which you have picked up already. The trick is

 

MAKE SURE YOU HAVE A SPACE AFTER 'Bearer'

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can refer to these blogs:

https://community.powerbi.com/t5/Community-Blog/Custom-Connector-in-Power-Automate-Microsoft-Flow-for-Power-BI/ba-p/1224350 

https://data-marc.com/2020/01/13/manage-all-your-power-bi-refreshes-in-one-place-with-power-automate-flow/ 

In addition, you should also note that the pro license can be refreshed 8 times a day and the Premium capacity can be refreshed 48 times a day.


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

Anonymous
Not applicable

Grrrr, I am so annoyed, but also very happy.

 

I have found my error. Its not because of the loop, that was a red herring! What it was and the reason why it's so annoying is, as part of the http REST API call is your header. This has your autorization, to the left you have Bearer and your access_token which you have picked up already. The trick is

 

MAKE SURE YOU HAVE A SPACE AFTER 'Bearer'

lbendlin
Super User
Super User

1. Write your own custom connector. Swagger file examples can be found on the interwebs

2. Power Automate has a ready-made action to request the refresh of a Power BI dataset.  That could take care of your second request.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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