Giter Club home page Giter Club logo

avito-php-api-autoload's Introduction

SwaggerClient-php

Получение отчётов о публикации и редактировании объявлений через Автозагрузку Авито API для бизнеса предоставляется согласно Условиям использования.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

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

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

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

// Configure OAuth2 access token for authorization: AuthorizationCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure OAuth2 access token for authorization: ClientCredentials
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AutoloadApi(
    // 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
);
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$ad_id = "ad_id_example"; // string | Идентификатор объявления из XML
$authorization = "authorization_example"; // string | Токен для авторизации

try {
    $result = $apiInstance->getAutoloadItemInfo($user_id, $ad_id, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AutoloadApi->getAutoloadItemInfo: ', $e->getMessage(), PHP_EOL;
}

// Configure OAuth2 access token for authorization: AuthorizationCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure OAuth2 access token for authorization: ClientCredentials
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AutoloadApi(
    // 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
);
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$authorization = "authorization_example"; // string | Токен для авторизации

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

// Configure OAuth2 access token for authorization: AuthorizationCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure OAuth2 access token for authorization: ClientCredentials
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AutoloadApi(
    // 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
);
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$report_id = 56; // int | Идентификатор отчета
$authorization = "authorization_example"; // string | Токен для авторизации

try {
    $result = $apiInstance->getReportById($user_id, $report_id, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AutoloadApi->getReportById: ', $e->getMessage(), PHP_EOL;
}

// Configure OAuth2 access token for authorization: AuthorizationCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure OAuth2 access token for authorization: ClientCredentials
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AutoloadApi(
    // 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
);
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$authorization = "authorization_example"; // string | Токен для авторизации
$per_page = 56; // int | Количество ресурсов на страницу
$page = 56; // int | Номер страницы

try {
    $result = $apiInstance->getReports($user_id, $authorization, $per_page, $page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AutoloadApi->getReports: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://api.avito.ru/

Class Method HTTP request Description
AutoloadApi getAutoloadItemInfo GET /autoload/v1/accounts/{user_id}/items/{ad_id}/ Получение информации о выгрузке объявления
AutoloadApi getLastReport GET /autoload/v1/accounts/{user_id}/reports/last_report/ Получение данных последнего актуального отчета
AutoloadApi getReportById GET /autoload/v1/accounts/{user_id}/reports/{reportId}/ Получение данных отчета по ID
AutoloadApi getReports GET /autoload/v1/accounts/{user_id}/reports/ Список отчетов об автозагрузке

Documentation For Models

Documentation For Authorization

AuthorizationCode

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://avito.ru/oauth
  • Scopes:
  • autoload:reports: Получение отчетов Автозагрузки
  • autoteka:previews: Получение и создание превью Автотеки
  • autoteka:reports: Получение и создание отчетов Автотеки
  • items:apply_vas: Применение дополнительных услуг
  • items:info: Получение информации об объявлениях
  • job:cv: Получение информации резюме
  • job:negotiations: Получение информации об откликах на вакансии
  • job:write: Изменение объявлений вертикали Работа
  • messenger:read: Чтение сообщений в мессенджере Авито
  • messenger:write: Модифицирование сообщений в мессенджере Авито
  • short_term_rent:read: Получение информации об объявлениях краткосрочной аренды
  • short_term_rent:write: Изменение объявлений краткосрочной аренды
  • stats:read: Получение статистики объявлений
  • user:read: Получение информации о пользователе
  • user_balance:read: Получение баланса пользователя
  • user_operations:read: Получение истории операций пользователя

ClientCredentials

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:

Author

[email protected]

avito-php-api-autoload's People

Contributors

darkvovich avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

arslan1992

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.