campaignReplicate()

Existing campaign is replicated and the ID of the new campaign is returned.

campaignReplicate(string $cid) : string
Input parameters
  • cid - campaign ID
Information obtained
  • campaign copy ID

Examples

mgapi_campaignReplicate.php
campaignReplicate($cid);
 
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load campaignReplicate()!\n";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    echo "New Campaign Id = " . $retval . "\n";
}
xml-rpc_campaignReplicate.php
 new xmlrpcval($apikey),
                    'cid' => new xmlrpcval($campaignId)
                ),
                'struct');
$f = new xmlrpcmsg('campaignReplicate', array($v));
$c = new xmlrpc_client($apiUrl["path"], $apiUrl['host'], 80);
$c->setDebug($debug);
$r = &$c->send($f);
 
header("Content-Type: text/plain");
if (!$r->faultCode()) {
    $retval = php_xmlrpc_decode($r->value());
    echo "New Campaign Id = " . $retval . "\n";
} else {
    echo "Unable to run campaignReplicate()!\n";
    echo "\tCode=" . $r->faultCode() . "\n";
    echo "\tMsg=" . $r->faultString() . "\n";
}
mgapi_campaignReplicate.py
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.campaignReplicate(cid)
if api.errorCode:
    print "Unable to load campaignReplicate()!"
    print "\tCode=", api.errorCode
    print "\tMsg=", api.errorMessage
else:
    print "New Campaign Id = ", retval

© 2010-2017 Mailigen. All rights reserved.