covox/avito_api2

dev-master 2019-09-16 16:36 UTC

This package is auto-updated.

Last update: 2024-09-13 13:36:29 UTC


README

通用信息 API 描述以 Swagger 3.0 格式提供。您可以使用此文件了解 API 方法,并使用 Swagger Codegen 工具或在线服务 Swagger Editor 生成您选择的编程语言的基本代码。强烈建议根据 使用条款 使用 Avito API for Business。
  • 电话: +7 495 777-10-66
  • 电子邮件: <a href="mailto:supportautoload@avito.ru">supportautoload@avito.ru
  • 此 PHP 包由 Swagger Codegen 项目自动生成

    • API 版本:1
    • 构建包: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\AccessApi(
        // 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()
    );
    $grant_type = "grant_type_example"; // string | Тип OAuth flow. В данный момент поддерживается только client_credentials
    $client_id = "client_id_example"; // string | 
    $client_secret = "client_secret_example"; // string | 
    
    try {
        $result = $apiInstance->getAccessToken($grant_type, $client_id, $client_secret);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling AccessApi->getAccessToken: ', $e->getMessage(), PHP_EOL;
    }
    ?>

    API 端点文档

    所有 URI 都相对于 https://api.avito.ru/

    模型文档

    授权说明文档

    所有端点都不需要授权。

    作者

    supportautoload@avito.ru