metatavu/metaform-api-client-php

此包已废弃且不再维护。未建议替代包。

0.1.1 2018-11-10 07:24 UTC

This package is not auto-updated.

Last update: 2024-08-14 09:02:10 UTC


README

Metaform的REST API

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

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

需求

PHP 5.5及更高版本

安装与使用

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/metatavu/metaform-api-client-php.git"
    }
  ],
  "require": {
    "metatavu/metaform-api-client-php": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/metaform-api-client-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

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

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

// Configure API key authorization: bearer
Metatavu\Metaform\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Metatavu\Metaform\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$api_instance = new Metatavu\Metaform\Api\AttachmentsApi();
$realmId = "realmId_example"; // string | realm id
$attachmentId = "attachmentId_example"; // string | Attachment id

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

?>

API端点文档

所有URI相对于https://

模型文档

授权文档

bearer

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

作者