« Back to Documentation OverviewcampaignDelete – v1.1
campaignDelete(string apikey, string cid)
Delete a campaign. Seriously, "poof, gone!" - be careful!
| Parameters | mcapi_campaignDelete.php| apikey | a valid API Key for your user account. Get by calling Get by visiting your API dashboard |
| cid | the Campaign Id to delete |
| Returns | | boolean |
true if the delete succeeds, otherwise an error will be thrown |
Examples (1)
download example code
[1] mcapi_campaignDelete.php
<?php
/**
This Example shows how to send Delete Campaigns via the MCAPI class.
**/
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey
$api = new MCAPI($apikey);
$retval = $api->campaignDelete($campaignId);
if ($api->errorCode){
echo "Unable to Delete Campaign!"; echo "\n\tCode=".$api->errorCode; echo "\n\tMsg=".$api->errorMessage."\n"; } else {
echo "Campaign Deleted!\n"; }