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
colmcag
New Member

API request 405 Method not Allowed Error

Hi,

 

I am getting a 405 error when trying to connect to Open FIGI:

 

colmcag_0-1678977575961.png

 

The request is similar to the below postman query:

 

colmcag_1-1678977617440.png

 

This is what I've tried in PowerQuery (I've also tried with idType and idValue parameters):

 

colmcag_2-1678977862615.png

 

Any ideas?

 

Thanks,

Colm

 

 

1 ACCEPTED SOLUTION

Hi @colmcag 

 

I don't have this problem in my Excel. It works well too. Did you select Anonymous for the data source like below? If not, go to Home > Data source settings and clear all permissions. Then select Anonymous for it. 

vjingzhang_0-1679536759634.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

View solution in original post

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @colmcag 

 

You can create a blank query in Power Query Editor, open its Advanced Editor, clear all M code there, then paste below code into it and click "Done". Use "Anonymous" type for Credentials. 

let
    url = "https://api.openfigi.com/v3/mapping",
    headers = [#"Content-Type" = "application/json"],
    postData = Text.ToBinary("[{""idType"": ""ID_ISIN"", ""idValue"": ""US4592001014""}]"),
    response = Web.Contents(
        url,
        [
            Headers = headers,
            Content = postData
        ]
    ),
    jsonResponse = Json.Document(response)
in
    jsonResponse

 

This will return you a record as you get with Postman. You can expand the record to get the result in it. The sample file has been attached at bottom. 

vjingzhang_0-1679368391964.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

thanks @v-jingzhang .

 

Interestingly this works fine when I use Power Query in PowerBI.

However, when I use Power Query in Excel, it gives the following error:

 

DataSource.Eror: Web.Contents with the Content Option is only supported when connecting anonymously.

It allowed me to edit settings > ok

And then we are back to the same 405 error again.

 

Any idea why this happens in excel?

 

Thanks,

Colm

Hi @colmcag 

 

I don't have this problem in my Excel. It works well too. Did you select Anonymous for the data source like below? If not, go to Home > Data source settings and clear all permissions. Then select Anonymous for it. 

vjingzhang_0-1679536759634.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

ams1
Super User
Super User

Hi @colmcag 

 

From your screenshots I see that in Postman you are doing a POST request, but using "From Web" in PowerQuery you're doing a GET request.

 

Either lookup how to do a POST request in PowerQuery OR post the Postman-generated cURL request here (after you remove confidential information from it!) and we'll try to help you out.

 

Please mark this as answer if it helped.

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.

Top Solution Authors
Top Kudoed Authors