丹麦数字图书馆/ddb-cover-service-php-client

1.0.1 2023-02-15 11:35 UTC

This package is auto-updated.

Last update: 2024-09-15 14:59:58 UTC


README

这是一个DDF封面服务的PHP API客户端。此服务为通过isbn、issn、faust、pid索引的图书馆材料提供封面。该服务由丹麦数字图书馆提供。

认证说明

认证通过OAuth2对auth.dbc.dk进行。要获取有效令牌,请按照1.2. 密码授权中的说明操作。要使用此工具中的“授权”选项,请使用您的'client_id'和'client_secret',并为用户名和密码都填写'@'。

实现说明

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

  • API版本:2.0
  • 包版本:2.0.0
  • 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen

要求

PHP 5.5及以上

安装和用法

Composer

要使用Composer安装绑定,请执行以下操作:

composer require danskernesdigitalebibliotek/ddb-cover-service-php-client

手动安装

下载文件并包含autoload.php

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

入门指南

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

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

// Configure OAuth2 access token for authorization: oauth
$config = CoverService\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new CoverService\Api\CoverApi(
    // 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
);
$type = "type_example"; // string | The type of the identifier, i.e. 'isbn', 'faust', 'pid' or 'issn'
$identifiers = array("identifiers_example"); // string[] | A list of identifiers of {type}. Maximum number os identifiers per reqeust is 200
$sizes = array("sizes_example"); // string[] | A list of image sizes (Cloudinary transformations) for the cover(s) you want to receive.

try {
    $result = $apiInstance->getCoverCollection($type, $identifiers, $sizes);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CoverApi->getCoverCollection: ', $e->getMessage(), PHP_EOL;
}
?>

API端点文档

所有URI都是相对于/

模型文档

授权文档

oauth

  • 类型:OAuth
  • 流程:密码
  • 授权URL:
  • 作用域:
  • ****:

作者