PHP code example of colling-media / stackadapt-api

1. Go to this page and download the library: Download colling-media/stackadapt-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

colling-media / stackadapt-api example snippets


    composer 

    


onfigure API key authorization: api_key
CollingMedia\StackAdapt\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// CollingMedia\StackAdapt\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');

$api_instance = new CollingMedia\StackAdapt\Api\CampaignApi();
$body = new \CollingMedia\StackAdapt\Model\CampaignRequest(); // \CollingMedia\StackAdapt\Model\CampaignRequest | 

try {
    $result = $api_instance->createCampaign($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignApi->createCampaign: ', $e->getMessage(), PHP_EOL;
}