rauwebieten/elvis-dam-client-php

为elvis dam rest api生成的PHP代码

1.0.0 2020-01-16 08:23 UTC

This package is auto-updated.

Last update: 2024-09-14 03:49:15 UTC


README

BETA通知

此API仍在开发中。所有API方法都是可用的,但它们在未来的Elvis版本中可能会发生变化。

简介

Elvis REST API允许您自定义并集成外部应用程序与Elvis。以下是一些您可以使用API完成的示例
  • 搜索资产。
  • 下载资产、预览或其他版本。
  • 上传新资产。
  • 更改资产元数据。
  • 搜索、创建、重命名和删除文件夹。
  • 创建共享链接。

尝试API方法

在此页面上,您可以尝试新的API方法。在尝试它们之前,需要授权。此API(尚无)中不存在授权方法,这意味着我们将使用旧的API授权方法

1. 使用/services/apilogin进行身份验证。例如

curl -X POST https://:8080/services/apilogin -F username=admin -F password=changemenow

2. 复制authToken。
3. 点击授权按钮,并使用'Bearer <authToken>'作为值。
4. 点击授权,页面现在已授权,您现在可以尝试API方法。

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

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

需求

PHP 5.5及更高版本

安装与使用

Composer

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

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

然后运行composer install

手动安装

下载文件并包含autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请遵循安装过程,然后运行以下命令

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

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

$apiInstance = new Swagger\Client\Api\AssetApi(
    // 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
);
$id = "id_example"; // string | Asset identifier

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

?>

API端点文档

所有URI都相对于https://dam.vaf.be

模型文档

授权文档

授权

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

作者