Forum Discussion

colmcag's avatar
colmcag
New Member
3 years ago
Solved

API request 405 Method not Allowed Error

Hi,

 

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

 

 

The request is similar to the below postman query:

 

 

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

 

 

Any ideas?

 

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. 

     

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

     

4 Replies

  • ams1's avatar
    ams1
    Responsive Resident

    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.

  • v-jingzhang's avatar
    v-jingzhang
    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. 

     

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

     

    • colmcag's avatar
      colmcag
      New Member

      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

      • v-jingzhang's avatar
        v-jingzhang
        Community Support

        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. 

         

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