找到你要的答案

Q:import.io curl simple data integration

Q:import.io卷曲,简单的数据集成

I want to get the simple api integration from https://import.io via curl. I created a magic api and struggle now to get the data.

Do I use the magic api on the browser, it works fine. But with curl I get a {"code":"NOT_AUTHORIZED"}. Obvious that the authentication did not work.

Here's my code

#!/bin/bash

login=foo@bar.com
pass=foobar
userid=foo-bar
apikey=1f2o3o4b5a6r

curl --user $login:$pass https://api.import.io/store/data/033fbe66-13b7-4cf2-ba9c-58183a567a6f/_query?input/webpage/url=https%3A%2F%2Fwww.zalando.de%2Flp-ons-wom-sale-cat-v1%2F%3Forder%3Dsale&_user=$userid&_apikey=$apikey

What am I doing wrong? And how do I get it run with curl?

我想找到简单的API集成https://import.io通过卷曲。我创建了一个神奇的API和斗争现在得到的数据。

我在浏览器上使用了魔力API,效果很好。但卷曲我得到一个{“代码”:“not_authorized”}。显然,认证没有工作。

这是我的密码

#!/bin/bash

login=foo@bar.com
pass=foobar
userid=foo-bar
apikey=1f2o3o4b5a6r

curl --user $login:$pass https://api.import.io/store/data/033fbe66-13b7-4cf2-ba9c-58183a567a6f/_query?input/webpage/url=https%3A%2F%2Fwww.zalando.de%2Flp-ons-wom-sale-cat-v1%2F%3Forder%3Dsale&_user=$userid&_apikey=$apikey

我做错什么了?我如何得到它运行与卷曲?

answer1: 回答1:

I could get it running. Found https://github.com/import-io/bashtractor/blob/master/bashtractor.sh which solved my problem.

我可以让它运行。发现https://github.com/import-io/bashtractor/blob/master/bashtractor.sh解决我的问题。

api  curl  basic-authentication  import.io