Forum Discussion
API request 405 Method not Allowed Error
- 3 years ago
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.
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.
- colmcag3 years agoNew 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-jingzhang3 years agoCommunity 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.