conviu/allegro-api

这是 Allegro.pl API。更多信息请访问 https://developer.allegro.pl/about

dev-master 2024-09-20 07:00 UTC

This package is auto-updated.

Last update: 2024-09-20 07:00:43 UTC


README

这是 Allegro.pl API。更多信息请访问 https://developer.allegro.pl/about

安装与使用

要求

PHP 7.2 及以上。

Composer

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

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

然后运行 composer install

您的项目可以自由选择喜欢的 http 客户端,请要求提供 http 客户端功能的包: https://packagist.org.cn/providers/psr/http-client-implementation https://packagist.org.cn/providers/php-http/async-client-implementation https://packagist.org.cn/providers/psr/http-factory-implementation

例如

composer require guzzlehttp/guzzle php-http/guzzle7-adapter http-interop/http-factory-guzzle

手动安装

下载文件并包含 autoload.php

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

入门指南

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

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



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


$apiInstance = new AllegroApi\Api\AdditionalServicesApi(
    // If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
    // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
    new GuzzleHttp\Client(),
    $config
);
$additional_services_group_request = new \AllegroApi\Model\AdditionalServicesGroupRequest(); // \AllegroApi\Model\AdditionalServicesGroupRequest | Additional service group body

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

API 端点

所有 URI 都相对于 https://api.allegro.pl

模型

授权

用户bearer-token

  • 类型: OAuth
  • 流程: accessCode
  • 授权URL: https://allegro.pl/auth/oauth/authorize
  • 作用域: N/A

应用程序bearer-token

  • 类型: OAuth
  • 流程: application
  • 授权URL: ``
  • 作用域: N/A

测试

运行测试,使用

composer install
vendor/bin/phpunit

作者

关于此包

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

  • API版本: latest
    • 生成器版本: 7.6.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen