1
我一直在尝试使用shopify_api gem上传资产。我确信我有适当的OAuth2范围(write_themes),并且读取甚至销毁它们都没有问题。问题是在尝试创建或更新资产时出现404错误。写入Shopify资产时发生404错误
这里的宝石创建请求:
PUT: /admin/themes/3650318/assets.json [{"Content-Type"=>"application/json", "User-Agent"=>"ShopifyAPI/3.0.3 ActiveResource/4.0.0.beta1 Ruby/2.0.0", "X-Shopify-Access-Token"=>"ommitted"}] ({"key":"templates/index.liquid","attachment":"base64 attachment omitted"})
仅供参考,这里是(当然包裹在ShopifyAPI::Session
,)我用来做请求的代码:
ShopifyAPI::Asset.create(key: 'snippets/test.liquid', attachment: some_base64_data, theme_id: 3650318)
或者:
asset = ShopifyAPI::Asset.new(key: 'snippets/test.liquid', attachment: baset64_data, theme_id: 3650318)
asset.save
任何想法?