vivebamba/bamba-sdk-php

1.3.3 2021-11-03 22:44 UTC

This package is auto-updated.

Last update: 2024-09-29 05:43:12 UTC


README

Bamba API 的 SDK

安装与使用

要求

PHP 7.2 及以上版本。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/vivebamba/bamba-sdk-php.git"
    }
  ],
  "require": {
    "vivebamba/bamba-sdk-php": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门指南

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

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



// Configure API key authorization: ApiKeyAuth
$config = Bamba\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Bamba\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new Bamba\Api\BambaAdvisorApi(
    // 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
);
$advisorMessageRequest = new \Bamba\Model\AdvisorMessageRequest(); // \Bamba\Model\AdvisorMessageRequest

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

API 端点

所有 URI 都相对于 https://sandbox.vivebamba.com/v1

模型

授权

ApiKeyAuth

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

测试

要运行测试,使用

composer install
vendor/bin/phpunit

作者

desarrollo@vivebamba.com

关于此包

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

  • API 版本: 1.3.3
    • 包版本: 1.3.3
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen