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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
shuhn1229
Helper III
Helper III

Refreshing a Model with REST API POST Calls

Hi all,

 

I have a PowerBI model that interacts with a REST API datasource. This particular datasource only reports using POST calls. I used the workaround described here: https://community.powerbi.com/t5/Desktop/Power-BI-Desktop-and-REST-API-POST-METHOD/m-p/196892 . My POST datacall has an authorization header FWIW.

 

This all works fine and I can refresh all the data manually in desktop. However when I schedule a refresh and try to enter credentials for the POST source it errors out (anonymous doesnt work, neither does basic with my username and PW).

 

1) any luck on getting this to work?

2) is there a way where the POST source can be left out of the scheduled refresh?

 

Thanks!

Steve

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

1. mind mentioning the error message?

2. you can always choose to use a gateway and  to skip the connection test on the gateway, although that is not recommended.

View solution in original post

5 REPLIES 5
shuhn1229
Helper III
Helper III

I figured this out. The key is getting a gateway setup as users pointer out.

v-yueyunzh-msft
Community Support
Community Support

Hi , @shuhn1229 

As far as I understand, the API corresponding to the connection is normally accessed using anonymous mode. There should be a token string in the request header of your API, the general token is generated by another API, you can try to create the API that generated this token as a function in Power Query, and then generate a token to pass into your parameters. Then both use anonymous credentials to log in. If your API can only be accessed on your intranet, you may also need to download the on-premise data gateway on your computer to configure the corresponding credentials.

For more information, you can refer to :
Power BI Gateway | Microsoft Power BI

On-premises data gateway - Power BI | Microsoft Learn

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Hi @v-yueyunzh-msft 

 

The datasource can only be accessed locally (e.g. mycompany.database.com) and as noted above, login requires a UN/PW that is provided by the AUTH header in my code. I'll look into the data gateway.

 

Steve

lbendlin
Super User
Super User

1. mind mentioning the error message?

2. you can always choose to use a gateway and  to skip the connection test on the gateway, although that is not recommended.

Hi @lbendlin thank you for responding.

 

Two important notes:

  • 1) the site can only be accessed internally... e.g. mycompany.database.com, which can only be accessed by UN and PW (see note on the auth header)
  • 2) errors out is the wrong verbiage. the refresh essentially times out (freezes etc) when using the web client to refresh in any mode (anonymous, basic etc). I've tried skipping the connection.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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