Subscribers.GetUnsubscribed PHP example

Has anyone got (or could anyone post) an example of using Subscribers.GetUnsubscribed with PHP?  I've gone through the API docs, but it's not making sense for me today!

roshodgekiss roshodgekiss, 6 years ago

Hi Joff, have you checked out the PHP wrapper? I believe there's a file with usage instructions for this method. Otherwise, feel free to post some of your code and we'll get our devs to take a look.


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
Joff Joff, 6 years ago

Cheers Ros, I've cracked it.

For anyone interested...

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

$apikey = 'xxxxxxxxxxxxxxxxxxxxxxx';
$list_id = 'xxxxxxxxxxxxxxxxxxxxxxx';    
$date = '2010-10-01 00:00:00';

//-------------------------------------------------------------------------------    
    
    $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->subscribersGetUnsubscribed( $date, $list_id );
    
    echo '<br><br>';
    print_r($result);

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

Get started for free
1-888-533-8098