Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Latest commit

 

History

History
40 lines (31 loc) · 929 Bytes

README.md

File metadata and controls

40 lines (31 loc) · 929 Bytes

yandex-direct-api

Offical yandex direct API documentation

Installation

composer require nk2ge5k/yandex-direct-api

Usage

use directapi/DirectApiService;
use directapi/services/campaigns/criterias/CampaignsSelectionCriteria;
use directapi/services/campaigns/enum/CampaignStateEnum;
use directapi/services/campaigns/enum/CampaignFieldEnum;

$token = YOUR_TOKEN;
$login = CLIENT_LOGIN;

$client = new DirectApiService($token, $login);

$campaigns = $client
    ->getCampaignsService()
    ->get(
        new CampaignsSelectionCriteria(
            [   
                'States' => [
                    CampaignStateEnum::ON
                ]   
            ]   
        ),  
        CampaignFieldEnum::getValues()
    );  

foreach ( $campaigns as $campaign ) { 
    // do something
}