jonlaliberte/overseerr-api-php

此包的最新版本(v1.0.1)没有可用的许可证信息。

由 Swagger 生成的 Overseerr API 的 PHP 客户端

v1.0.1 2022-10-10 20:27 UTC

This package is not auto-updated.

Last update: 2024-09-25 03:57:58 UTC


README

这是 Overseerr API 后端的文档。支持两种主要的身份验证方法:- Cookie 身份验证:有效的 /auth/plex/auth/local 登录将生成有效的身份验证cookie。- API 密钥身份验证:也可以通过传递由 Overseerr 生成的有效 API 密钥和 X-Api-Key 头来登录。

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

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

要求

PHP 5.5 及以上版本

安装 & 使用

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@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');

$apiInstance = new Swagger\Client\Api\AuthApi(
    // 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()
);
$body = new \Swagger\Client\Model\AuthLocalBody(); // \Swagger\Client\Model\AuthLocalBody | 

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

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

$apiInstance = new Swagger\Client\Api\AuthApi(
    // 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
);

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

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

$apiInstance = new Swagger\Client\Api\AuthApi(
    // 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
);

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

$apiInstance = new Swagger\Client\Api\AuthApi(
    // 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()
);
$body = new \Swagger\Client\Model\AuthPlexBody(); // \Swagger\Client\Model\AuthPlexBody | 

try {
    $result = $apiInstance->authPlexPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthApi->authPlexPost: ', $e->getMessage(), PHP_EOL;
}
?>

API 端点文档

所有 URI 都相对于 {server}/api/v1

模型文档

授权文档

apiKey

  • 类型: API密钥
  • API密钥参数名: X-Api-Key
  • 位置: HTTP头部

cookieAuth

  • 类型: API密钥
  • API密钥参数名: connect.sid
  • 位置: URL查询字符串

作者