Delete campaign from the account of a specific user.

It is not possible to restore the deleted campaign (!). By deleting campaign, campaign reports will also be deleted.
campaignDelete(string $cid) : boolean
Input parameters
  • cid - campaign ID
Information obtained
  • true, if the request for campaign delete has succeeded. Otherwise, an error message is returned.


header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load campaignDelete()!\n";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    echo "Campaign Deleted!\n";
 new xmlrpcval($apikey),
                    'cid' => new xmlrpcval($campaignId)
$f = new xmlrpcmsg('campaignDelete', array($v));
$c = new xmlrpc_client($apiUrl["path"], $apiUrl['host'], 80);
$r = &$c->send($f);
header("Content-Type: text/plain");
if (!$r->faultCode()) {
    $retval = php_xmlrpc_decode($r->value());
    echo "Campaign Deleted!\n";
} else {
    echo "Unable to run campaignDelete()!\n";
    echo "\tCode=" . $r->faultCode() . "\n";
    echo "\tMsg=" . $r->faultString() . "\n";
from lib.config import * #contains apikey
from lib.MGAPI import MGAPI
# This Example shows how to ping using the MGAPI.php class and do some basic error checking.
api = MGAPI(apikey)
cid = campaignId
retval = api.campaignDelete(cid)
if api.errorCode:
    print "Unable to load campaignDelete()!"
    print "\tCode=", api.errorCode
    print "\tMsg=", api.errorMessage
    print "Campaign Deleted!"

© 2010-2020 Mailigen. All rights reserved.