我正在尝试从Shopify上的在线商店调用Instagram API。我不能使用javascript,因为Instagram不允许请求。这不是一个糟糕的电话或错误,他们只是否认它。所以,我使用Liquid来调用API。
我想知道是否有类似php的卷曲,我可以使用液体。有谁知道这样的事情?以下是我到目前为止的情况:
{% assign call = endpoint | append: params %}
{{ open(call) }}
它没有输出任何东西,虽然我认为它会输出一个布尔值。 “call”变量确实是正确的。
任何帮助都会很棒,谢谢!
答案 0 :(得分:2)
您无法使用液体进行API调用。您必须使用Shopify的API和您自己的应用程序(假设使用PHP构建)来发出这些请求。虽然,JS没有理由不做这项工作。我之前使用http://instafeedjs.com/在Shopify主题上取得了巨大成功。
答案 1 :(得分:2)
As per the first answer, you cannot make direct API calls with liquid. What you need to do is to create a private app proxy that serves as a proxy for the real app that you want to call. Most of the documentation around creating app proxy is for public apps that you sell on the Shopify store, but don't worry, all you need to do is to provide the authentication parameters from when you create a private app to the app proxy and it will work fine.
I hope that helps.