PHP code example of zaycon / whatcounts

1. Go to this page and download the library: Download zaycon/whatcounts 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/ */

    

zaycon / whatcounts example snippets


$whatcounts = new ZayconWhatCounts\WhatCounts( [YOUR_API_REALM], [YOUR_API_PASSWORD] );

$realm = $whatcounts->getRealmSettings();

$lists = $whatcounts->showLists();

$list_id = 10;
$list = $whatcounts->getListById($list_id);

$list_name = "Marketing List";
$list = $whatcounts->getListByName($list_name);

$list = new ZayconWhatCounts\MailingList;
$list
	->setListName('API Test');
	->setDescription('This is a test list');
	->setFromAddress('[email protected]');
	->setReplyToAddress('[email protected]');
	->setBounceAddress('[email protected]');
	->setTrackClicks(true);
	->setTrackOpens(true);

$new_list = $whatcounts->createList($list);

$list_id = 10;
$list = $whatcounts->showList($list_id);
$list->setListName('API Test');

$is_updated = $whatcounts->updateList($list);

$articles = $whatcounts->showArticles();

$article = new ZayconWhatCounts\Article();
$article->setId(5);

$whatcounts->getArticleById($article);

$article = new ZayconWhatCounts\Article();
$article->setName('article-1');

$whatcounts->getArticleByName($article);

$article_name = 'article-1';
$destination_article_name = 'article-1-copy';

$destination_article_id = $whatcounts->copyArticle($article_name, $destination_article_name);

$article = new ZayconWhatCounts\Article();
$article
    ->setName('blank-test');

$whatcounts->createBlankArticle($article);

$article = new ZayconWhatCounts\Article();
$article
    ->setName('test')
    ->setTitle('Test Article Title')
    ->setDescription('Test Article Description')
    ->setDeck('This is the actual article deck.')
    ->setCallout('Test Article Callout')
    ->setBody('Test Article Body')
    ->setAuthorName('Joe Smith')
    ->setAuthorBio('This is the bio for Joe Smith')
    ->setAuthorEmail('[email protected]')
    ->setFolderId(0);

$whatcounts->createArticle($article);

$article = new ZayconWhatCounts\Article();
$article
    ->setId(5)
    ->setName('article-1')
    ->setTitle('Test Article Title')
    ->setDescription('Test Article Description')
    ->setDeck('This is the actual article deck.')
    ->setCallout('Test Article Callout')
    ->setBody('Test Article Body')
    ->setAuthorName('Joe Smith')
    ->setAuthorBio('This is the bio for Joe Smith')
    ->setAuthorEmail('[email protected]')
    ->setFolderId(0);

$is_updated = $whatcounts->updateArticle($article);

$article_name = 'article-1-copy';

$is_deleted = $whatcounts->deleteArticle($article_name);

$subscriber = new ZayconWhatCounts\Subscriber;
$subscriber
	->setFirstName("Joe");
	->setLastName("Smith");

$subscribers = $whatcounts->findSubscribers($subscriber);

$list_id = 10;

$subscriber = new ZayconWhatCounts\Subscriber;
$subscriber
	->setFirstName("Joe");
	->setLastName("Smith");
	->setEmail("[email protected]");

$subscribers = $whatcounts->findSubscriberInList($subscriber, $list_id, TRUE);

$subscriber = new ZayconWhatCounts\Subscriber;
$subscriber
	->setFirstName("Joe");
	->setLastName("Smith");
	->setEmail("[email protected]");
	->setAddress1("1234 Main St");
	->setAddress2("Suite 100");
	->setCity("Spokane");
	->setState("WA");
	->setZip("99201");
	->setCountry("US");
	->setPhone("5095551212");
	->setFax("5095551213");
	->setCompany("Zaycon");
	->setForceSub(false);
	->setFormat(99);
	->setOverrideConfirmation(false);
	->setListId(10);

$subscribers = $whatcounts->subscribe($subscriber);

$subscriber = new ZayconWhatCounts\Subscriber;
$subscriber
	->setFirstName("Joe");
	->setLastName("Smith");
	->setEmail("[email protected]");
	->setListId(10);

$unsubscriber = $whatcounts->unsubscribe($subscriber, $subscriber->getListId(), FALSE);

$subscriber_id = 123456;
$subscriber = $whatcounts->showSubscriber($subscriber_id);

$deleted_subscriber = $whatcounts->deleteSubscriber($subscriber);

$subscriber_emails = [
	'[email protected]',
	'[email protected]'
];

$deleted_subscribers = $whatcounts->deleteSubscribers($subscriber_emails);

$subscriber_id = 123456;
$subscriber = $whatcounts->showSubscriber($subscriber_id);

$subscriber_id = 123456;
$subscriber = $whatcounts->showSubscriber($subscriber_id);

$subscriber_lists = $subscriber->getLists();

$subscriber
	->setListId($subscriber_lists[0]->getListId());
	->setLastName("Smith Jr.");

$updated_subscriber = $whatcounts->updateSubscriber($subscriber);

$subscriber_id = 123456;
$subscriber = $whatcounts->showSubscriber($subscriber_id);
$whatcounts->changeEmailAddress($subscriber, "[email protected]");

$campaign_name = "test_automation_campaign";
		
$subscriber_id = 123456;
$subscriber = $whatcounts->showSubscriber($subscriber_id);

$updated_subscriber = $whatcounts->addSubscriberToLifecycleCampaign($subscriber, $campaign_name);

$message = new \ZayconWhatCounts\Mail();
$message
	->setListId(10);
	->setFromAddress('[email protected]');
	->setReplyToAddress('[email protected]');
	->setBounceAddress('[email protected]');
	->setSenderAddress(NULL);
	->setSendToAddress('[email protected]');
	->setCcToAddress('[email protected]');
	->setTemplateId(3);
	->setBodyText('This is plain text.'); // This is usually defined in the template.
	->setBodyHtml('<h2>This is a test</h2>'); // This is usually defined in the template.
	->setSubject('Test from API'); // This is usually defined in the template.
	->setFormat(99);
	->setCampaignName(NULL);
	->setVirtualMta(NULL);
	->setDuplicate(FALSE);
	->setIgnoreOptout(TRUE); // Set to TRUE if sending a transactional email, which ignores any opt out.
	->setCharacterEncoding(NULL); // This is usually defined in the template.
	->setData('customLastname,customSalutation^Smith,Mr');

$output = $whatcounts->sendOneOffMessage($message);

$message = new \ZayconWhatCounts\Mail();
$message
	->setListId(10);
	->setFromAddress('[email protected]');
	->setReplyToAddress('[email protected]');
	->setBounceAddress('[email protected]');
	->setSenderAddress(NULL);
	->setSendToAddress('[email protected]');
	->setCcToAddress('[email protected]');
	->setTemplateId(3);
	->setBodyText('This is plain text.'); // This is usually defined in the template.
	->setBodyHtml('<h2>This is a test</h2>'); // This is usually defined in the template.
	->setSubject('Test from API'); // This is usually defined in the template.
	->setFormat(99);
	->setCampaignName(NULL);
	->setVirtualMta(NULL);
	->setDuplicate(FALSE);
	->setIgnoreOptout(TRUE); // Set to TRUE if sending a transactional email, which ignores any opt out.
	->setCharacterEncoding(NULL); // This is usually defined in the template.
	->setData('customLastname,customSalutation^Smith,Mr');

$output = $whatcounts->subscribeAndSendOneOffMessage($message);

$campaign = new ZayconWhatCounts\Campaign();
$campaign
	->setListId(23)
	->setTemplateId(35)
	->setSubject('Test Campaign')
	->setSeedListId(0)
	->setSegmentationId(0)
	->setFormat(99)
	->setAlias('')
	->setRss(0)
	->setVmta('vmta1')
	->setAbDefinitionId(0)
	->setDeployedByEmail('')
	->setReturnTaskId(1)
	->setSeedDelivery(0)
	->setSendNotification('[email protected]');

$output = $whatcounts->launchCampaign($campaign);

$subscriber = $whatcounts->showSubscriber(123456);

$output = $whatcounts->showUserEvents($subscriber);

$subscriber = $whatcounts->showSubscriber(123456);

$output = $whatcounts->reportSubscriberEvents($subscriber);

$list_id = 10;
$output = $whatcounts->reportUnsubscribes($list_id);

$list_id = 10;
$days = 30;

$output = $whatcounts->showOptouts($list_id, $days);

$days = 30;

$output = $whatcounts->showGlobalOptouts($days);

$output = $whatcounts->showABDefinitions();

$ab_definition = new ZayconWhatCounts\ABTest();
$ab_definition->setId(4);

$whatcounts->getABDefinition($ab_definition);

$ab_definition_id = 4;
$output = $whatcounts->reportABTestStatistics($ab_definition_id);

$output = $whatcounts->showTemplates();

$template_id = 14;
$output = $whatcounts->getTemplateById($template_id);

$template_name = 'Test Template';
$output = $whatcounts->getTemplateByName();

$template = new ZayconWhatCounts\Template;
$template
	->setFolderId(0)
	->setName("Another Test Template")
	->setSubject("Another Test from WhatCounts")
	->setBodyPlain("Hello %%set salutation = \$customSalutation%%%%\$salutation%% %%set last_name = \$customLastname%%%%\$last_name%%!")
	->setBodyHtml("<html><head><title></title></head><body><h2>Hello %%set salutation = \$customSalutation%%%%\$salutation%% %%set last_name = \$customLastname%%%%\$last_name%%!</h2></body></html>")
	->setDescription("This is the description");

$whatcounts->createTemplate($template);

$template = new ZayconWhatCounts\Template;
$template
	->setTemplateId(35)
	->setFolderId(0)
	->setName("Another Test Template")
	->setSubject("Another Test from WhatCounts (updated)")
	->setBodyPlain("(updated) Hello %%set salutation = \$customSalutation%%%%\$salutation%% %%set last_name = \$customLastname%%%%\$last_name%%!")
	->setBodyHtml("<html><head><title></title></head><body><h2>(updated) Hello %%set salutation = \$customSalutation%%%%\$salutation%% %%set last_name = \$customLastname%%%%\$last_name%%!</h2></body></html>")
	->setDescription("This is the description (updated)");

$output = $whatcounts->updateTemplate($template);

define('TEMPLATE_TYPE_PLAIN', 1);
define('TEMPLATE_TYPE_HTML', 2);
	
$template = new ZayconWhatCounts\Template;
$template
	->setName("Another Test Template");

$output = $whatcounts->previewTemplate($template, TEMPLATE_TYPE_HTML);

$output = $whatcounts->showSegmentationRules();

$segmentation_rule = new ZayconWhatCounts\SegmentationRule();
$segmentation_rule->setListId(14);
$segmentation_rule->setName('Test Segmentation Rule');
$segmentation_rule->setDescription('This is a test segmentation rule.');
$segmentation_rule->setType('adv');
$segmentation_rule->setRules("email='[email protected]'");

$output = $whatcounts->createSegmentationRule($segmentation_rule);

$segmentation_rule = new ZayconWhatCounts\SegmentationRule();
$segmentation_rule->setId(7);
$segmentation_rule->setListId(14);
$segmentation_rule->setName('Test Segmentation Rule (updated)');
$segmentation_rule->setDescription('This is a test segmentation rule.');
$segmentation_rule->setType('adv');
$segmentation_rule->setRules("email='[email protected]'");

$output = $whatcounts->updateSegmentationRule($segmentation_rule);

$segmentation_rule = new ZayconWhatCounts\SegmentationRule();
$segmentation_rule->setId(7);

$output = $whatcounts->deleteSegmentationRule($segmentation_rule);

$segmentation_rule = new ZayconWhatCounts\SegmentationRule();
$segmentation_rule->setId(8);
$segmentation_rule->setListId(14);

$output = $whatcounts->testSegmentationRule($segmentation_rule);

$social_provider = new ZayconWhatCounts\SocialProvider();
$social_provider->setProviderId(522);

$whatcounts->getSocialProviderById($social_provider);

$social_provider = new ZayconWhatCounts\SocialProvider();
$social_provider
	->setUsername('[email protected]')
	->setProviderName('facebook');

$whatcounts->getSocialProviderByUserName($social_provider);

$social_provider = new ZayconWhatCounts\SocialProvider();
$social_provider->setProviderId(522);

$is_deleted = $whatcounts->deleteSocialProviderById($social_provider);

$social_provider = new ZayconWhatCounts\SocialProvider();
$social_provider
	->setUsername('Joe Smith')
	->setProviderName('linkedin');

$is_deleted = $whatcounts->deleteSocialProviderByUserName($social_provider);

$template = new ZayconWhatCounts\Template();	$template->setTemplateId(14);

$social_provider = new ZayconWhatCounts\SocialProvider();
$social_provider->setProviderName('twitter');

$social_post = new ZayconWhatCounts\SocialPost();
$social_post->setPost('This is a post created from the API.');

$output = $whatcounts->setSocialPostForTemplate($template, $social_provider, $social_post);

$template = new ZayconWhatCounts\Template();
$template->setTemplateId(14);

$output = $whatcounts->getSocialPostsByTemplateId($template);

$template = new ZayconWhatCounts\Template();
$template->setName('Test Template');

$output = $whatcounts->getSocialPostsByTemplateName($template);

$count = 5;
$output = $whatcounts->showCampaigns($count);

$start_date = "01/01/2016";
$end_date = "03/01/2016";
$show_hidden = 0;

$output = $whatcounts->reportCampaignList($start_date, $end_date, $show_hidden);

$campaign_statistics = new ZayconWhatCounts\Report();
$campaign_statistics->setCampaignId(43);

$whatcounts->showCampaignStatistics($campaign_statistics);

$campaign_ids = array(43,7);

$output = $whatcounts->showMultipleCampaginStatistics($campaign_ids);

$campaign_id = 47;
$output = $whatcounts->reportCampaignClicks($campaign_id);

$campaign_id = 47;
$url = 'https://www.example.com';
$is_exact = FALSE;
$is_unique = FALSE;

$output = $whatcounts->reportSubscriberClicks($campaign_id, $url, $is_exact, $is_unique);

$campaign_id = 47;
$start_date = '2/1/2016';
$end_date = '4/1/2016';

$output = $whatcounts->reportDailyStatistics($campaign_id, $start_date, $end_date);

$campaign_id = 13;
$by_subscriber = 1;
$os_name = 'ios';
$browser = 'safari';
$client_type = 'iphone';

$output = $whatcounts->reportBrowserInfo($campaign_id, $by_subscriber, $os_name, $browser, $client_type);

define('BOUNCE_TYPE_SOFT', 30);
define('BOUNCE_TYPE_HARD', 31);
define('BOUNCE_TYPE_COMPLAINT', 34);
define('BOUNCE_TYPE_BLOCK', 36);

$campaign_id = 47;
$start_date = '2/1/2016';
$end_date = '4/1/2016';
$bounce_type = BOUNCE_TYPE_HARD;

$output = $whatcounts->reportBounceStatistics($campaign_id, $bounce_type, $start_date, $end_date);

define('EVENT_TYPE_NONE', 0);
define('EVENT_TYPE_SENT', 9);
define('EVENT_TYPE_OPEN', 10);
define('EVENT_TYPE_CLICKTHROUGH', 11);
define('EVENT_TYPE_SNA_SHARING', 13);
define('EVENT_TYPE_SUBSCRIBE', 20);
define('EVENT_TYPE_UNSUBSCRIBE', 21);
define('EVENT_TYPE_GLOBAL_UNSUBSCRIBE', 22);
define('EVENT_TYPE_UNIVERSAL_UNSUBSCRIBE', 23);
define('EVENT_TYPE_SOFT_BOUNCE', 30);
define('EVENT_TYPE_HARD_BOUNCE', 31);
define('EVENT_TYPE_DATA_SET', 32);
define('EVENT_TYPE_CONFIRMATION MESSAGE', 33);
define('EVENT_TYPE_ABUSE', 34);
define('EVENT_TYPE_INVALID_EMAIL_ADDRESS', 35);
define('EVENT_TYPE_BLOCKED', 36);
define('EVENT_TYPE_DISPLAY_MSG', 40);
define('EVENT_TYPE_SNA_DISPLAY_MESSAGE', 41);
define('EVENT_TYPE_VIDEO_DISPLAY_MSG', 42);
define('EVENT_TYPE_MOBILE_DISPLAY_MSG', 43);
define('EVENT_TYPE_FTAF', 50);
define('EVENT_TYPE_FTAF_ANON', 51);
define('EVENT_TYPE_USER_LOGIN', 60);
define('EVENT_TYPE_USER_LOGOUT', 61);
define('EVENT_TYPE_USER_PASSWORD_CHANGE', 62);
define('EVENT_TYPE_SENDMESSAGE', 70);
define('EVENT_TYPE_SNA_POST_MESSAGE', 71);
define('EVENT_TYPE_SENDMESSAGE_CC', 72);
define('EVENT_TYPE_CONVERSION_DEEPLINK_TRACKING', 80);
define('EVENT_TYPE_CLICK_PREF_UNSUB', 81);
define('EVENT_TYPE_CLICK_PREF_MANAGER', 82);
define('EVENT_TYPE_CLICK_PREF_SUB', 83);
define('EVENT_TYPE_RSS_VISIT', 102);
define('EVENT_TYPE_SUPPRESS', 103);
define('EVENT_TYPE_ANALYTICS_ABANDONMENT', 121);
define('EVENT_TYPE_ANALYTICS_PURCHASES', 122);
define('EVENT_TYPE_ANALYTICS_VIEWS', 123);
define('EVENT_TYPE_VIDEO_LOADED', 130);
define('EVENT_TYPE_VIDEO_PLAYED', 131);
define('EVENT_TYPE_VIDEO_PAUSED', 132);
define('EVENT_TYPE_VIDEO_STOPPED', 133);
define('EVENT_TYPE_VIDEO_INTERRUPTED', 134);
define('EVENT_TYPE_VIDEO_CHECK_POINT_25', 135);
define('EVENT_TYPE_VIDEO_CHECK_POINT_50', 136);
define('EVENT_TYPE_VIDEO_CHECK_POINT_75', 137);
define('EVENT_TYPE_VIDEO_COMPLETED', 138);
define('EVENT_TYPE_SNA_DIGG_VIEW', 151);
define('EVENT_TYPE_SNA_DIGG_SHARE', 152);
define('EVENT_TYPE_SNA_FACEBOOK_VIEW', 153);
define('EVENT_TYPE_SNA_FACEBOOK_SHARE', 154);
define('EVENT_TYPE_SNA_LINKEDIN_VIEW', 155);
define('EVENT_TYPE_SNA_LINKEDIN_SHARE', 156);
define('EVENT_TYPE_SNA_MYSPACE_VIEW', 157);
define('EVENT_TYPE_SNA_MYSPACE_SHARE', 158);
define('EVENT_TYPE_SNA_PING_VIEW', 159);
define('EVENT_TYPE_SNA_PING_SHARE', 160);
define('EVENT_TYPE_SNA_TWITTER_VIEW', 161);	define('EVENT_TYPE_SNA_TWITTER_SHARE', 162);
define('EVENT_TYPE_SNA_GOOGLEPLUS_VIEW', 163);
define('EVENT_TYPE_SNA_GOOGLEPLUS_SHARE', 164);
define('EVENT_TYPE_SNA_STUMBLEUPON_VIEW', 165);
define('EVENT_TYPE_SNA_STUMBLEUPON_SHARE', 166);
define('EVENT_TYPE_SNA_PINTEREST_VIEW', 167);
define('EVENT_TYPE_SNA_PINTEREST_SHARE', 168);
define('EVENT_TYPE_SOFT_BOUNCE_UNSUBSCRIBE', 230);
define('EVENT_TYPE_SNA_DIGG_CLICKTHROUGH', 301);
define('EVENT_TYPE_SNA_FACEBOOK_CLICKTHROUGH', 302);
define('EVENT_TYPE_SNA_LINKEDIN_CLICKTHROUGH', 303);
define('EVENT_TYPE_SNA_MYSPACE_CLICKTHROUGH', 304);
define('EVENT_TYPE_SNA_PING_CLICKTHROUGH', 305);	define('EVENT_TYPE_SNA_TWITTER_CLICKTHROUGH', 306);
define('EVENT_TYPE_SNA_GOOGLEPLUS_CLICKTHROUGH', 307);
define('EVENT_TYPE_SNA_STUMBLEUPON_CLICKTHROUGH', 308);
define('EVENT_TYPE_SNA_PINTEREST_CLICKTHROUGH', 309);
define('EVENT_TYPE_SNA_FACEBOOK_POST', 401);
define('EVENT_TYPE_SNA_LINKEDIN_POST', 402);
define('EVENT_TYPE_SNA_TWITTER_POST', 403);
define('EVENT_TYPE_PROFILE_MANAGER', 999999);

$event_type = EVENT_TYPE_CLICKTHROUGH;
$start_datetime = '02/01/2016 13:00:00';
$end_datetime = '03/01/2016 13:00:00';
$offset = 0;

$output = $whatcounts->reportTrackedEvents($event_type, $start_datetime, $end_datetime, $offset);

define('EVENT_TYPE_NONE', 0);
define('EVENT_TYPE_SENT', 9);
define('EVENT_TYPE_OPEN', 10);
define('EVENT_TYPE_CLICKTHROUGH', 11);
define('EVENT_TYPE_SNA_SHARING', 13);
define('EVENT_TYPE_SUBSCRIBE', 20);
define('EVENT_TYPE_UNSUBSCRIBE', 21);
define('EVENT_TYPE_GLOBAL_UNSUBSCRIBE', 22);
define('EVENT_TYPE_UNIVERSAL_UNSUBSCRIBE', 23);
define('EVENT_TYPE_SOFT_BOUNCE', 30);
define('EVENT_TYPE_HARD_BOUNCE', 31);
define('EVENT_TYPE_DATA_SET', 32);
define('EVENT_TYPE_CONFIRMATION MESSAGE', 33);
define('EVENT_TYPE_ABUSE', 34);
define('EVENT_TYPE_INVALID_EMAIL_ADDRESS', 35);
define('EVENT_TYPE_BLOCKED', 36);
define('EVENT_TYPE_DISPLAY_MSG', 40);
define('EVENT_TYPE_SNA_DISPLAY_MESSAGE', 41);
define('EVENT_TYPE_VIDEO_DISPLAY_MSG', 42);
define('EVENT_TYPE_MOBILE_DISPLAY_MSG', 43);
define('EVENT_TYPE_FTAF', 50);
define('EVENT_TYPE_FTAF_ANON', 51);
define('EVENT_TYPE_USER_LOGIN', 60);
define('EVENT_TYPE_USER_LOGOUT', 61);
define('EVENT_TYPE_USER_PASSWORD_CHANGE', 62);
define('EVENT_TYPE_SENDMESSAGE', 70);
define('EVENT_TYPE_SNA_POST_MESSAGE', 71);
define('EVENT_TYPE_SENDMESSAGE_CC', 72);
define('EVENT_TYPE_CONVERSION_DEEPLINK_TRACKING', 80);
define('EVENT_TYPE_CLICK_PREF_UNSUB', 81);
define('EVENT_TYPE_CLICK_PREF_MANAGER', 82);
define('EVENT_TYPE_CLICK_PREF_SUB', 83);
define('EVENT_TYPE_RSS_VISIT', 102);
define('EVENT_TYPE_SUPPRESS', 103);
define('EVENT_TYPE_ANALYTICS_ABANDONMENT', 121);
define('EVENT_TYPE_ANALYTICS_PURCHASES', 122);
define('EVENT_TYPE_ANALYTICS_VIEWS', 123);
define('EVENT_TYPE_VIDEO_LOADED', 130);
define('EVENT_TYPE_VIDEO_PLAYED', 131);
define('EVENT_TYPE_VIDEO_PAUSED', 132);
define('EVENT_TYPE_VIDEO_STOPPED', 133);
define('EVENT_TYPE_VIDEO_INTERRUPTED', 134);
define('EVENT_TYPE_VIDEO_CHECK_POINT_25', 135);
define('EVENT_TYPE_VIDEO_CHECK_POINT_50', 136);
define('EVENT_TYPE_VIDEO_CHECK_POINT_75', 137);
define('EVENT_TYPE_VIDEO_COMPLETED', 138);
define('EVENT_TYPE_SNA_DIGG_VIEW', 151);
define('EVENT_TYPE_SNA_DIGG_SHARE', 152);
define('EVENT_TYPE_SNA_FACEBOOK_VIEW', 153);
define('EVENT_TYPE_SNA_FACEBOOK_SHARE', 154);
define('EVENT_TYPE_SNA_LINKEDIN_VIEW', 155);
define('EVENT_TYPE_SNA_LINKEDIN_SHARE', 156);
define('EVENT_TYPE_SNA_MYSPACE_VIEW', 157);
define('EVENT_TYPE_SNA_MYSPACE_SHARE', 158);
define('EVENT_TYPE_SNA_PING_VIEW', 159);
define('EVENT_TYPE_SNA_PING_SHARE', 160);
define('EVENT_TYPE_SNA_TWITTER_VIEW', 161);	define('EVENT_TYPE_SNA_TWITTER_SHARE', 162);
define('EVENT_TYPE_SNA_GOOGLEPLUS_VIEW', 163);
define('EVENT_TYPE_SNA_GOOGLEPLUS_SHARE', 164);
define('EVENT_TYPE_SNA_STUMBLEUPON_VIEW', 165);
define('EVENT_TYPE_SNA_STUMBLEUPON_SHARE', 166);
define('EVENT_TYPE_SNA_PINTEREST_VIEW', 167);
define('EVENT_TYPE_SNA_PINTEREST_SHARE', 168);
define('EVENT_TYPE_SOFT_BOUNCE_UNSUBSCRIBE', 230);
define('EVENT_TYPE_SNA_DIGG_CLICKTHROUGH', 301);
define('EVENT_TYPE_SNA_FACEBOOK_CLICKTHROUGH', 302);
define('EVENT_TYPE_SNA_LINKEDIN_CLICKTHROUGH', 303);
define('EVENT_TYPE_SNA_MYSPACE_CLICKTHROUGH', 304);
define('EVENT_TYPE_SNA_PING_CLICKTHROUGH', 305);	define('EVENT_TYPE_SNA_TWITTER_CLICKTHROUGH', 306);
define('EVENT_TYPE_SNA_GOOGLEPLUS_CLICKTHROUGH', 307);
define('EVENT_TYPE_SNA_STUMBLEUPON_CLICKTHROUGH', 308);
define('EVENT_TYPE_SNA_PINTEREST_CLICKTHROUGH', 309);
define('EVENT_TYPE_SNA_FACEBOOK_POST', 401);
define('EVENT_TYPE_SNA_LINKEDIN_POST', 402);
define('EVENT_TYPE_SNA_TWITTER_POST', 403);
define('EVENT_TYPE_PROFILE_MANAGER', 999999);

$campaign_id = 47;
$event_type = EVENT_TYPE_CLICKTHROUGH;
$start_datetime = '02/01/2016 13:00:00';	$end_datetime = '03/16/2016 13:00:00';
$offset = 0;

$output = $whatcounts->reportTrackedEventsByCampaign($campaign_id, $event_type, $start_datetime, $end_datetime, $offset);

$list_id = 13;
$days = 45;

$output = $whatcounts->showHardBounces($list_id, $days);

$list_id = 13;
$days = 45;

$output = $whatcounts->showSoftBounces($list_id, $days);

$list_id = 13;
$days = 45;

$output = $whatcounts->showBlockBounces($list_id, $days);

$list_id = 13;
$days = 45;

$output = $whatcounts->showComplaints($list_id, $days);

$list_id = 13;
$start_datetime = '2/1/2016 12:00:00';
$end_datetime = '4/1/2016 11:59:59';

$output = $whatcounts->reportSubscriberByUpdate($list_id, $start_datetime, $end_datetime);

$list_id = 13;
$offset = 0;

$output = $whatcounts->reportSubscribersInList($list_id, $offset);