gladyshev / yandex-direct-client
有用的Yandex.Direct API v5客户端。
v4.1.0
2021-07-05 19:35 UTC
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-09-06 02:20:11 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' => [...] // ]