campaignUpdate()

Update of one of the previously created values of campaign parameters.

Works if campaign is not yet sent.
campaignUpdate(string $cid, string $name, mixed $value) : boolean
Input parameters
  • cid - campaign ID
  • name - name of parameter (see Creation of new campaign possible parameter names)
  • value - value of parameter (see Creation of new campaign possible parameter values)
    If list ID is used, all of the previous lists will be deleted.
    If template ID is used, HTML content will be overwritten by content of the given template.

Information obtained
  • true, if parameter update has succeeded. Otherwise, an error message is returned.

Examples

mgapi_campaignUpdate.php
campaignUpdate($cid, $name, $value);
 
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load campaignUpdate()!\n";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    echo "SUCCESS! \n";
}
xml-rpc_campaignUpdate.php
 new xmlrpcval($apikey),
                    'cid' => new xmlrpcval($campaignId),
                    'name' => new xmlrpcval('title'),
                    'value' => new xmlrpcval('New Title')
                ),
                'struct');
$f = new xmlrpcmsg('campaignUpdate', 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 "SUCCESS! \n";
} else {
    echo "Unable to run campaignUpdate()!\n";
    echo "\tCode=" . $r->faultCode() . "\n";
    echo "\tMsg=" . $r->faultString() . "\n";
}
mgapi_campaignUpdate.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
name = 'title'
value = 'New Title'
 
retval = api.campaignUpdate(cid, name, value)
if api.errorCode:
    print "Unable to load campaignUpdate()!"
    print "\tCode=", api.errorCode
    print "\tMsg=", api.errorMessage
else:
    print "SUCCESS!"

© 2010-2017 Mailigen. All rights reserved.