springimport/swagger-magento2-client

由 swagger-codegen 生成的 Magento 2 的 Rest API 客户端。

0.3.0 2017-08-08 15:13 UTC

README

此 PHP 包由 Swagger Codegen 项目自动生成。

  • API 版本:2.1
  • 打包构建:io.swagger.codegen.languages.PhpClientCodegen

要求

PHP 5.4.0 及以上版本

安装与使用

Composer

要使用 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "require": {
    "springimport/swagger-magento2-client": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/SwaggerClient-php/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请按照 安装说明 进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new SpringImport\Swagger\Magento2\Client\Api\BackendModuleServiceV1Api();

try {
    $result = $api_instance->backendModuleServiceV1GetModulesGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BackendModuleServiceV1Api->backendModuleServiceV1GetModulesGet: ', $e->getMessage(), PHP_EOL;
}

?>

API 端点文档

所有 URI 都是相对于 http://example.com/rest/default

模型文档

授权文档

所有端点均不需要授权。

作者