如何使用 Rails 从 Shopify API admin 端点获取资源
How to GET resources from Shopify API admin Endpoint using Rails
我正在开发私人 Shopify 应用程序。我正在尝试获取此资源(来自 Shopify 端点):
https://store.myshopify.com/admin/products.json
以这种方式使用 Net::HTTP
库:
url = 'https://'+@api_key+':'+@password+'@storename.myshopify.com/admin/products.json'
uri = URI(url)
response = Net::HTTP.get(uri)
p = JSON.parse(response)
但我得到的是:
=> {"errors"=>"[API] Invalid API key or access token (unrecognized login or wrong password)"}
从 Shopify 管理端点获取资源的正确方法是什么?
我正在开发私人 Shopify 应用程序。我正在尝试获取此资源(来自 Shopify 端点):
https://store.myshopify.com/admin/products.json
以这种方式使用 Net::HTTP
库:
url = 'https://'+@api_key+':'+@password+'@storename.myshopify.com/admin/products.json'
uri = URI(url)
response = Net::HTTP.get(uri)
p = JSON.parse(response)
但我得到的是:
=> {"errors"=>"[API] Invalid API key or access token (unrecognized login or wrong password)"}
从 Shopify 管理端点获取资源的正确方法是什么?