zvps/volo-commerce-client

dev-master 2020-10-09 10:07 UTC

This package is auto-updated.

Last update: 2024-09-09 19:19:11 UTC


README

Volo 公共API

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

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

要求

PHP 5.4.0 及以上版本

安装与使用

Composer

要使用Composer安装绑定,请在composer.json中添加以下内容:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@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');

// Configure HTTP basic authorization: basicAuth
\VoloCommerce\Api\v1\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
\VoloCommerce\Api\v1\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new \VoloCommerce\Api\v1\Client\AuthenticationApi();
$authorization = "authorization_example"; // string | Base 64 encoded Basic Auth Header (base64[username:password]) i.e. if username is user123 and password is pass then header value will be Basic dXNlcjEyMzpwYXNz
$x_api_key = "x_api_key_example"; // string | API Key

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

?>

API端点文档

所有URI均相对于https://api.volocommerce.io/1.0

模型文档

授权文档

API密钥-头部

  • 类型:API密钥
  • API密钥参数名:x-api-key
  • 位置:HTTP头部

JWT-头部

  • 类型:API密钥
  • API密钥参数名:Authorization
  • 位置:HTTP头部

基本认证

  • 类型:HTTP基本认证

作者