faridmasoum / testapi
RMI Shopify 导入 API 库
2.0.9
2017-01-11 15:01 UTC
Requires
- php: >=5.4.0
- curl/curl: ^1.5
README
RMI 数据链路 API
安装
composer require faridmasoum/testapi
或添加
"faridmasoum/testapi": "*"
然后运行以下命令使用 composer 下载扩展:
$ composer update
基本设置
配置
使用方法
在项目根目录创建一个 index.php 文件,并在其中插入以下代码。
require __DIR__ . '/vendor/autoload.php'; use RMIDatalink\Fetch; use RMIDatalink\Datalink; use RMIDatalink\Enums\ResponseTypes; use RMIDatalink\Enums\ResponseProducts; use \Symfony\Component\VarDumper\Test\VarDumperTestTrait; $config = [ "api-path" => "http://rmiserver.rminno.com:8001/api", "limit" => 50, //limitation on all requests "access-key" => "z/uWekiobDEedhozKm6JntDkcHoUzKm6JntDkczKm6JntDkcaQ", //Datalink Access Key "bucket-name" => "faridConfigurableBucket", //bucket name "response-type" => ResponseTypes::Json, //response type of results "response-products" => ResponseProducts::All, //type of products Just Simples/Just Configurable/ Configurable>Simple ]; $apiObject = new Fetch($config); // required fields $fields = ['id', 'title', 'images', 'additionalImages', 'productType']; // get all products $ConfigurableProducts = $apiObject->configurableProducts(0, $fields);