예제 #1
0
<?php

require_once '../../../web_construction_set/autoload.php';
$auth = new \WebConstructionSet\Accounting\OAuth\Yandex(['client_id' => \Config::CLIENT_ID, 'client_secret' => \Config::CLIENT_SECRET]);
if ($auth->process()) {
    header('Content-Type: text/plain');
    if ($auth->getError()) {
        echo "Error: " . $auth->getError();
    } else {
        $strings = new \WebConstructionSet\Advertising\CampaignStrings\Yandex4($auth->getToken());
        echo implode("\n", $strings->get());
    }
}
예제 #2
0
<?php

require_once '../../../web_construction_set/autoload.php';
$appData = ['client_id' => \Config::CLIENT_ID, 'client_secret' => \Config::CLIENT_SECRET];
$oauth = new \WebConstructionSet\Accounting\OAuth\Yandex($appData);
if ($oauth->process()) {
    $token = $oauth->getToken();
    $error = $oauth->getError();
    ?>
<html><body>
Token: <?php 
    echo $token;
    ?>
<br/>
Error: <?php 
    echo $error;
    ?>
<br/>
</body></html>
<?php 
}