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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
kaym
Helper I
Helper I

Error 405: Method Not Allowed

Hello,

I am trying to load data through an API URL. However, I see this error as soon as I enter the URL. I was givien this URL by a team member who worked on this API. All I know is that it uses basic authentication and is a POST method.

 

kaym_0-1707160242402.png

 

2 REPLIES 2
Anonymous
Not applicable

hi, @kaym 

I'm happy to answer your questions. Sorry to hear you are getting a 405 error when using the API URL to get data. According to the RFC2616 document, 405 error is defined as follows:

The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.

We can troubleshoot the problem through the following points:

1.Check the API documentation: You should first make sure you are using the API URL correctly. For example, parameters that need to be passed and other conditions.

2.Try to connect using Advance method: Pass in the relevant parameters and ensure that the necessary request parameters are in the header. For example, User-Agent parameters, Content-type parameters, etc. If there are missing parameters in the post method, a 405 error will occur if the authentication is successful. As is the case with my second link for the same case below.

vjianpengmsft_0-1707210639267.png

3.Try sending the same request using other tools to determine whether the request is successful. If the request is successful, there is a problem with the settings in Power BI. If the request is unsuccessful, there is a problem with the API URL. Try adding the necessary parameters.

4.Try using Power Query to get the data.

 

 

RFC2616 document: https://www.ietf.org/rfc/rfc2616.txt

405 error document:https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/troubleshooting-http...

Cases of the same problem:

https://community.fabric.microsoft.com/t5/Power-Query/API-request-405-Method-not-Allowed-Error/td-p/...

Solved: Re: HTTP Actions - Power Platform Community (microsoft.com)

Use post method to get data in Power Query: https://datawithdom.com/2022/03/using-the-post-method-with-rest-apis-inside-power-bi/

 

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

HI @Anonymous ,

This is super helpful! 

I tried fixing it in power query but I am still getting errors like:

Expression.Error: The 'Authorization' header is only supported when connecting anonymously. These headers can be used with all authentication types: Accept, Accept-Charset, Accept-Encoding, Accept-Language, Cache-Control, Content-Type, If-Modified-Since, Prefer, Range, Referer


OR

DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously. Details: DataSourceKind=Web

this is how the API request should be:

kaym_0-1707245384165.png

 

API uses basic authentication and has a user encrypted

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.