« Back to Documentation Overview

campaignReplicate – v1.1

 campaignReplicate(string apikey, string cid)

Replicate a campaign.

Section
Campaign Related
mcapi_campaignReplicate.php
Parameters
apikey a valid API Key for your user account. Get by calling Get by visiting your API dashboard
cid the Campaign Id to replicate
Returns
string the id of the replicated Campaign created, otherwise an error will be thrown

Examples (1)

download example code

[1] mcapi_campaignReplicate.php

  1. <?php
  2. /**
  3. This Example shows how to send Replicate Campaigns via the MCAPI class.
  4. **/
  5. require_once 'inc/MCAPI.class.php';
  6. require_once 'inc/config.inc.php'; //contains apikey
  7.  
  8. $api = new MCAPI($apikey);
  9.  
  10. $retval = $api->campaignReplicate($campaignId);
  11.  
  12. if ($api->errorCode){
  13. echo "Unable to Replicate Campaign!";
  14. echo "\n\tCode=".$api->errorCode;
  15. echo "\n\tMsg=".$api->errorMessage."\n";
  16. } else {
  17. echo "New Campaign Id = $retval\n";
  18. }
  19.