« Back to Documentation Overview

campaignDelete – v1.1

 campaignDelete(string apikey, string cid)

Delete a campaign. Seriously, "poof, gone!" - be careful!

Section
Campaign Related
mcapi_campaignDelete.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 delete
Returns
boolean true if the delete succeeds, otherwise an error will be thrown

Examples (1)

download example code

[1] mcapi_campaignDelete.php

  1. <?php
  2. /**
  3. This Example shows how to send Delete 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->campaignDelete($campaignId);
  11.  
  12. if ($api->errorCode){
  13. echo "Unable to Delete Campaign!";
  14. echo "\n\tCode=".$api->errorCode;
  15. echo "\n\tMsg=".$api->errorMessage."\n";
  16. } else {
  17. echo "Campaign Deleted!\n";
  18. }
  19.