gladyshev / yandex-direct-client
Useful Yandex.Direct API v5 client.
Installs: 8 287
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 4
Forks: 7
Open Issues: 0
Requires
- php: ^7.4|^8.0
- ext-json: *
- ext-mbstring: *
- guzzlehttp/psr7: 1.9.1|2.7.0
- psr/http-client: 1.0.3
Requires (Dev)
- guzzlehttp/guzzle: 7.9.0
- phpunit/phpunit: 8.5.41
- psr/log: 1.1
- squizlabs/php_codesniffer: 3.5.8
- vimeo/psalm: 3.18.2
This package is auto-updated.
Last update: 2024-12-17 13:52:48 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' => [...] // ]