Shopify 资产 API 使用 PUT 方法更新 collection.liquid,使用 cURL 给出 404

Shopify Asset API updating collection.liquid using PUT method giving 404 with cURL

我正在尝试使用 Shopify API.
更新 collection.liquid 我在下面使用 Shopify API 包装器和 CodeIgniter,

Shopify API wrapper

此包装器使用 cURL 进行 API 调用。我已经使用这个库为 Shopify 制作了其他应用程序,它与 GET,POST 方法一起工作得很好。我第一次尝试使用 PUT 方法。它给我 cURL 错误 下面给出
错误 #22:请求的 URL 返回错误:404 未找到"

    protected function modify_asset($theme_id)
{

       $data = array(
            'API_KEY' => $this->config->item('shopify_api_key'),
            'API_SECRET' => $this->config->item('shopify_secret'),
            'SHOP_DOMAIN' => $this->session->userdata('shop_domain'),
            'ACCESS_TOKEN' => $this->session->userdata('access_token')
        );

        $this->load->library('shopify', $data);

        $fields = array(
            "asset" => array(

                "key" => "templates\/collection.liquid",
                "value" => "<p>We are busy updating the store for you and will be back within 10 hours.<\/p>"

            )
        );



        $args = array(

                 'URL' => '/admin/themes/163760333/assets.json',
                 'METHOD' => 'PUT',
                 'RETURNARRAY' => TRUE,
                 'DATA' => $fields
            );
        try{

            $modification_response = $this->shopify->call($args);
            return $modification_response;


        }
        catch(Exception $e){
            $modification_response = $e->getMessage();
            log_message('error','In Get Active Theme Id' . $modification_response);
            //redirect('/wrong/index');
            var_dump('In modification response ' . $modification_response);
            exit;
        }

}


}


以上是我实现 API 调用的函数。您可以在下方 link:
查看 cURL 选项及其实现 cURL options and happening of Shopify API call

注意:此请求在 POSTMAN 上运行良好。

我刚刚 运行 使用您提供的信息对此代码进行了一些测试,并且在删除 $fields['asset'][[ 中的反斜杠后能够成功提交=25=]] 按照上面的例子。

所以

"key" => "templates\/collection.liquid",

变为:

"key" => "templates/collection.liquid",

似乎 Shopify 不需要转义文件键中的正斜杠。