rspective/voucherify

Voucherify促销引擎REST API。请参阅https://docs.voucherify.io/docs获取更多详细信息。


README

Voucherify促销引擎REST API。请参阅https://docs.voucherify.io/docs获取更多详细信息。

更多信息,请访问https://www.voucherify.io/contact-support

安装与使用

要求

PHP 8.1及更高版本。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门指南

请遵循安装程序,然后运行以下操作

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



// Configure API key authorization: X-App-Id
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');

// Configure API key authorization: X-App-Token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\AsyncActionsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$asyncActionId = 'asyncActionId_example'; // string | Unique ID of the asynchronous operation.

try {
    $result = $apiInstance->getAsyncAction($asyncActionId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AsyncActionsApi->getAsyncAction: ', $e->getMessage(), PHP_EOL;
}

API端点

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

模型

授权

X-App-Id

  • 类型: API密钥
  • API密钥参数名: X-App-Id
  • 位置: HTTP头

X-App-Token

  • 类型: API密钥
  • API密钥参数名: X-App-Token
  • 位置: HTTP头

X-Client-Token

  • 类型: API密钥
  • API密钥参数名: X-Client-Token
  • 位置: HTTP头

X-Client-Application-Id

  • 类型: API密钥
  • API密钥参数名: X-Client-Application-Id
  • 位置: HTTP头

使用 Docker 运行本地测试

  1. .env.example 复制到 .env 并填写值。
  2. 运行 docker build -t php . 来构建镜像。
  3. 运行 docker run --rm php 来运行测试,并在测试完成后立即删除容器。

作者

support@voucherify.io

关于此包

此 PHP 包由 OpenAPI Generator 项目自动生成

  • API 版本: v2018-08-01
    • 包版本: 3.0.0
  • 构建包: org.openapitools.codegen.languages.PhpNextgenClientCodegen