gladyshev / yandex-direct-client
Useful Yandex.Direct API v5 client.
Installs: 7 993
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 4
Forks: 7
Open Issues: 0
Requires
- php: ^7.2
- ext-json: *
- ext-mbstring: *
- guzzlehttp/psr7: ~1.7.0
- psr/http-client: *
- psr/http-message: *
Requires (Dev)
- guzzlehttp/guzzle: ~7.2.0
- phpunit/phpunit: ~8.5.13
- psr/log: ~1.0
- squizlabs/php_codesniffer: ~3.5.8
This package is auto-updated.
Last update: 2024-11-06 02:43:38 UTC
README
Современный и удобный PHP-клиент Yandex.Direct API.
Требования
- PHP 7.2 и выше
Установка
$ composer require gladyshev/yandex-direct-client
Использование
$credentials = \Gladyshev\Yandex\Direct\Credentials::client( getenv('_TOKEN_') ); $httpClient = new \GuzzleHttp\Client(); // Guzzle 7 или любой другой PSR-18 HTTP-клиент $client = new \Gladyshev\Yandex\Direct\Client( $credentials, $httpClient ); $response = $client->campaigns->get( ['Ids' => [123545345, 23423234]], // SelectionCriteria ['Status', 'Currency', 'Funds'] // FieldNames ); print_r($response); // [ // 'request_id' => 8695244274068608439, // 'units_used_login' => 'ttt-agency', // 'units' => [ // 'debit' => 10, // 'rest' => 20828, // 'limit' => 64000 // ], // 'result' => [...] // ]