You are here

function MCAPI::campaigns in Mailchimp 6.2

Same name and namespace in other branches
  1. 5.2 MCAPI.class.php \MCAPI::campaigns()
  2. 5 MCAPI.class.php \MCAPI::campaigns()
  3. 6 MCAPI.class.php \MCAPI::campaigns()
  4. 7 MCAPI.class.php \MCAPI::campaigns()

Get the list of campaigns and their details matching the specified filters

Related

@example mcapi_campaigns.php @example xml-rpc_campaigns.php

@returnf string id Campaign Id (used for all other campaign functions) @returnf integer web_id The Campaign id used in our web app, allows you to create a link directly to it @returnf string list_id The List used for this campaign @returnf string folder_id The Folder this campaign is in @returnf string title Title of the campaign @returnf string type The type of campaign this is (regular,plaintext,absplit,rss,inspection,trans,auto) @returnf date create_time Creation time for the campaign @returnf date send_time Send time for the campaign - also the scheduled time for scheduled campaigns. @returnf integer emails_sent Number of emails email was sent to @returnf string status Status of the given campaign (save,paused,schedule,sending,sent) @returnf string from_name From name of the given campaign @returnf string from_email Reply-to email of the given campaign @returnf string subject Subject of the given campaign @returnf string to_email Custom "To:" email string using merge variables @returnf string archive_url Archive link for the given campaign @returnf boolean inline_css Whether or not the campaign content's css was auto-inlined @returnf string analytics Either "google" if enabled or "N" if disabled @returnf string analytics_tag The name/tag the campaign's links were tagged with if analytics were enabled. @returnf boolean authenticate Whether or not the campaign was authenticated @returnf boolean ecomm360 Whether or not ecomm360 tracking was appended to links @returnf boolean auto_tweet Whether or not the campaign was auto tweeted after sending @returnf boolean timewarp Whether or not the campaign used Timewarp @returnf boolean track_clicks_text Whether or not links in the text version of the campaign were tracked @returnf boolean track_clicks_html Whether or not links in the html version of the campaign were tracked @returnf boolean track_opens Whether or not opens for the campaign were tracked @returnf string segment_text a string marked-up with HTML explaining the segment used for the campaign in plain English @returnf array segment_opts the segment used for the campaign - can be passed to campaignSegmentTest() or campaignCreate()

Parameters

array $filters a hash of filters to apply to this query - all are optional:: string campaign_id optional - return a single campaign using a know campaign_id string list_id optional - the list to send this campaign to- get lists using lists() integer folder_id optional - only show campaigns from this folder id - get folders using campaignFolders() string status optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending" string type optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "trans", "auto" string from_name optional - only show campaigns that have this "From Name" string from_email optional - only show campaigns that have this "Reply-to Email" string title optional - only show campaigns that have this title string subject optional - only show campaigns that have this subject string sendtime_start optional - only show campaigns that have been sent since this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr) string sendtime_end optional - only show campaigns that have been sent before this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr) boolean exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true

integer $start optional - control paging of campaigns, start results at this campaign #, defaults to 1st page of data (page 0):

integer $limit optional - control paging of campaigns, number of campaigns to return with each call, defaults to 25 (max=1000):

Return value

array list of campaigns and their associated information (see Returned Fields for description)

File

./MCAPI.class.php, line 456

Class

MCAPI

Code

function campaigns($filters = array(), $start = 0, $limit = 25) {
  $params = array();
  $params["filters"] = $filters;
  $params["start"] = $start;
  $params["limit"] = $limit;
  return $this
    ->callServer("campaigns", $params);
}