我正在开发一个 shopify 应用程序,我想在其中运行 Ruby 中的脚本。我想根据此链接https://docs.shopify.com/api/collect更新收集对象的“位置”和“排序值” 。每次我尝试这样做时,都会出现 ActiveResource 错误。
这是我在 irb 中的代码:
require 'shopify'
require 'active_resource'
shop_url = "https://#{API_KEY}:{PASSWORD}@SHOP_NAME.myshopify.com/admin"
ShopifyAPI::Base.site = shop_url
product = ShopifyAPI::Collect.find(:id)
product.position = 4
product.save
我已经尝试了下面给出的代码,它在 irb 中运行良好
product = ShopifyAPI::Product.find(179761209)
product.handle = "burton-snowboard"
product.save
我收到了这个错误:
ActiveResource::ResourceNotFound:失败。响应代码 = 404。响应消息 = 未找到
我们可以在 Collect 对象上发送 http PUT 请求来更新位置吗?提前致谢..