我正在尝试从Algorithmia API获取数据到Power BI Desktop。
基本上,尝试将其转换为:
curl -X POST -d '"Test"' -H 'Content-Type: application/json' -H 'Authorization: Simple simAOH0ixjNUwV/qBMh1BW1fbKH1' https://api.algorithmia.com/v1/algo/tone/DemoAlgo/0.1.0?timeout=300进入Power Query M:
let
url= "https://api.algorithmia.com/v1/algo/tone/DemoAlgo/0.1.0",
auth_key = "'Simple simAOH0ixjNUwV/qBMh1BW1fbKH1'",
header = [#"Authorization" = auth_key, #"Content-Type" = "application/json"],
query = "'Test'",
webdata = Web.Contents(url, [Headers=header, Query = query]),
response = Json.Document(webdata)
in
response这是返回NOT found error: 404。
有人能帮上忙吗?
提前感谢!
发布于 2021-08-24 19:06:43
我这样做有点冒险,因为我自己在使用API方面还是个新手,但是从the API documentation for Algorithmia的角度来看,我认为您可能没有使用正确的端点名称。我认为您可能需要使用:https://api.algorithmia.com/v1/algorithms/:username/:algoname。我相信你用algo代替了算法。我还认为您可能需要从auth_key和query中删除撇号(单引号,如')。
希望这能帮助你走得更近。
发布于 2021-08-25 09:55:57
谢谢你的帮助。
我做到了这一点:
let
url= "https://api.algorithmia.com/v1/algo/tone/DemoAlgo/0.1.0?timeout=300",
auth_key = "simAOH0ixjNUwV/qBMh1BW1fbKH1",
header = [#"Authorization" = auth_key, #"Content-Type" = "application/json"],
post_contents = """Teste""",
webdata = Web.Contents(url, [Content=Text.ToBinary(post_contents), Headers=header]),
response = Json.Document(webdata)
in
responsehttps://stackoverflow.com/questions/68905824
复制相似问题