1. Go to this page and download the library: Download progdog-ru/avito_item library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
progdog-ru / avito_item example snippets
onfigure 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\ItemApi(
// 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 | Номер пользователя в Личном кабинете Авито
$item_id = 789; // int | Идентификатор объявления на сайте
$authorization = "authorization_example"; // string | Токен для авторизации
try {
$result = $apiInstance->getItemInfo($user_id, $item_id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->getItemInfo: ', $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\ItemApi(
// 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
);
$authorization = "authorization_example"; // string | Токен для авторизации
$per_page = 25; // int | Количество записей на странице (целое число больше 0 и меньше 100)
$page = 1; // int | Номер страницы (целое число больше 0)
$status = "active"; // string | Статус объявления на сайте (можно указать несколько значений через запятую)
$category = 56; // int | Идентификатор категории объявления
try {
$result = $apiInstance->getItemsInfo($authorization, $per_page, $page, $status, $category);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->getItemsInfo: ', $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\ItemApi(
// 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
);
$authorization = "authorization_example"; // string | Токен для авторизации
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$body = new \Swagger\Client\Model\ItemIdsRequestBody(); // \Swagger\Client\Model\ItemIdsRequestBody | Набор идентификаторов объявлений на сайте
try {
$result = $apiInstance->getVasPackagePrice($authorization, $user_id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->getVasPackagePrice: ', $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\ItemApi(
// 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
);
$authorization = "authorization_example"; // string | Токен для авторизации
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$body = new \Swagger\Client\Model\ItemIdsRequestBody(); // \Swagger\Client\Model\ItemIdsRequestBody | Набор идентификаторов объявлений на сайте
try {
$result = $apiInstance->getVasPrices($authorization, $user_id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->getVasPrices: ', $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\ItemApi(
// 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
);
$authorization = "authorization_example"; // string | Токен для авторизации
$content_type = "content_type_example"; // string | Тип данных запроса
$user_id = 789; // int | Идентификатор пользователя (клиента)
$body = new \Swagger\Client\Model\StatisticsShallowRequestBody(); // \Swagger\Client\Model\StatisticsShallowRequestBody | Набор параметров в теле запроса.
try {
$result = $apiInstance->itemStatsShallow($authorization, $content_type, $user_id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->itemStatsShallow: ', $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\ItemApi(
// 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
);
$body = new \Swagger\Client\Model\CallsStatsRequest(); // \Swagger\Client\Model\CallsStatsRequest |
$authorization = "authorization_example"; // string | Токен для авторизации
$content_type = "content_type_example"; // string | Тип данных запроса
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
try {
$result = $apiInstance->postCallsStats($body, $authorization, $content_type, $user_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->postCallsStats: ', $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\ItemApi(
// 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
);
$authorization = "authorization_example"; // string | Токен для авторизации
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$item_id = 789; // int | Идентификатор объявления на сайте
$body = new \Swagger\Client\Model\VasIdRequestBody(); // \Swagger\Client\Model\VasIdRequestBody |
try {
$result = $apiInstance->putItemVas($authorization, $user_id, $item_id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->putItemVas: ', $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\ItemApi(
// 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
);
$authorization = "authorization_example"; // string | Токен для авторизации
$user_id = 789; // int | Номер пользователя в Личном кабинете Авито
$item_id = 789; // int | Идентификатор объявления на сайте
$body = new \Swagger\Client\Model\PackageIdRequestBodyV2(); // \Swagger\Client\Model\PackageIdRequestBodyV2 |
try {
$result = $apiInstance->putItemVasPackageV2($authorization, $user_id, $item_id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ItemApi->putItemVasPackageV2: ', $e->getMessage(), PHP_EOL;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.