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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
tcouey
Frequent Visitor

Getting web data via api and authorization token

Hi

 

I am using an api authorization token generated from one of our vendor websites. I then use an api endpoint, and the authorization header/token to pull our data from the vendor into powerbi desktop. 

 

Is it possible to then distribute this data within a report based off of the one users connection to the api end point? The user with the token, only gets the token within the vendor site after whitelisting their ip address within the vendor tool.

 

My questions are, if possible how can I create a job/schedule to sync the data, and if it's possible to then share this report to numerous users outside of the venor tool.

 

Thank you for any help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tcouey ,

 

Powerbi supports setting the format of its request headers when connecting to a web data source.
If you need to provide an API authorization token when connecting to a web data source, you can add the header in the advance option.
The Bearer your_api_token_here section is the value of the Authorization header, where Bearer is a common authentication scheme followed by the actual API token.

vkongfanfmsft_0-1705483960128.png

 

For more details, you can refer to below document:

Connect to a webpage from Power BI Desktop - Power BI | Microsoft Learn

Power Query Web connector - Power Query | Microsoft Learn

 

Best Regards,
Adamk Kong

 

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

4 REPLIES 4
BenoitB
New Member

Hi
I also want to use Token Authentication for a semantic model in Power BI Service. 
Creating it with Power BI Desktop is OK as said @Anonymous, I used the Authorization header.

But when publishing it on my workspace in app.powerbi.com, I can't use Gateway Datasource to schedule refresh because it seems that On-premise Gateway Datasource Web only supports Anonymous or Basic Auth ?
Is there any workaround ?
Best regards,
BenoitB

Anonymous
Not applicable

Hi @tcouey ,

 

Powerbi supports setting the format of its request headers when connecting to a web data source.
If you need to provide an API authorization token when connecting to a web data source, you can add the header in the advance option.
The Bearer your_api_token_here section is the value of the Authorization header, where Bearer is a common authentication scheme followed by the actual API token.

vkongfanfmsft_0-1705483960128.png

 

For more details, you can refer to below document:

Connect to a webpage from Power BI Desktop - Power BI | Microsoft Learn

Power Query Web connector - Power Query | Microsoft Learn

 

Best Regards,
Adamk Kong

 

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

 

Thanks for the assist Adamk! 

 

I'm able to connect properly and can see all my needed tables from the api endpoint. 

 

Do you have any suggestions on ways to keep this data sync updated when publishing to a workspace for endusers to view?

 

Anonymous
Not applicable

Hi @tcouey ,

 

That means you want to synchronize and update the data from the web api in workspace so that end users can see the latest data after synchronization.
I would suggest that you can use the rest api for refreshes, but note: for shared capacity, you can initiate up to 8 requests per day, including refreshes performed using scheduled refreshes.

like below:

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

 

For more details, you can read below document:

Enhanced refresh with the Power BI REST API - Power BI | Microsoft Learn

Datasets - Refresh Dataset - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Best Regards,
Adamk Kong

 

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

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.