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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

dynamic token retrieval with POST request ”DataSource.Error: Web.Contents failed to get contents 405


This is my last attempt of getting this to work. 


I am trying to integrate an REST API source to power bi, the goal is to have it incrementally refresh, but the operations for the REST API uses dynamic access tokens. So I need to make a function with power query that sends a POST request to the api to get the token.


To get the bearer token, I need to send a POST request to



which uses basic auth (base64-encoded string of 'username:password’). 


I get everything to work in postman, I have tried all kinds of different ways to make a function with power Query (see my last threads,  ). And now I figured I’ve got everything working, it still returns error code 405. 


I’ve narrowed it down to have something to do with being a POST request? 


Here are the two alternatives I narrowed it down to that should work but doesn't. the first one is where I state the username and the password in the url, but I have also tried having the basic token as a header and several other things.





Helpful resources


Fabric certifications survey

Certification feedback opportunity for the community.


Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors