pica9/campaign-drive-api-client

1.2.1 2016-05-03 21:37 UTC

This package is not auto-updated.

Last update: 2024-10-26 19:32:30 UTC


README

Usage

require_once 'autoload.php';

$api = new Pica9\CampaignDrive\ApiClient\DefaultApi;
$api->getApiClient()->getConfig()
    ->setHost('https://your-campaign-drive-domain.com');
try {
    $token = $api->createToken(
        "client_credentials",
        "your-client-id",
        "your-client-secret",
        "read:document"
    );
    $api->getApiClient()->getConfig()
        ->setAccessToken($token->getAccessToken());
    $doc = $api->getDocumentById(1);
    echo $doc->getName();
} catch (\Pica9\CampaignDrive\ApiClient\ApiException $e) {
    echo "Error encountered!\n";
    echo $e->getResponseObject()->getReasonPhrase();
}