Intergrated Campaign Monitor API

I'm trying to integrate the CM API into a PHP CMS that some else has built. Could some give me direction on how to start...? This is my first time implementing an API. I read all the documentation (I think..or the ones that I could find) to help me start?


Leigh, 8 years ago

...Do you used Campaign.Create..php as an include in your layout?


ini_set ('display_errors', 1);
error_reporting (E_ALL);


//-----------------------------INPUT PARAMS---------------------------------------

$apikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$clientid = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';       
$campaign_name = 'March newsletter';
$subject = 'March newsletter';
$from_name = 'John Smith';
$from_email = '';
$reply_email = '';
$html_content = '';
$text_content = '';
$subscriber_listid = array('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$subscriber_segments = "";

    $cm = new CampaignMonitor( $apikey );
    //Optional statement to include debugging information in the result
    $cm->debug_level = 1;
    //This is the actual call to the method
    $result = $cm->campaignCreate( $clientid, $campaign_name, $subject, $from_name, $from_email, $reply_email, $html_content, $text_content, $subscriber_listid, "" );
    echo '<br><br>';
    //Print out the debugging info


Join 150,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free