Back to Documentation Overview
campaigns
public static campaigns(string apikey, array filters, integer start, integer limit)
Get the list of campaigns and their details matching the specified filters
- Section:
- Campaign Related
- Parameters:
apikey a valid API Key for your user account. Get by visiting your API dashboard 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 start optional - control paging of campaigns, start results at this campaign #, defaults to 1st page of data (page 0) limit optional - control paging of campaigns, number of campaigns to return with each call, defaults to 25 (max=1000) - Returns:
- array - list of campaigns and their associated information (see Returned Fields for description)
- Returned Fields:
string id Campaign Id (used for all other campaign functions) integer web_id The Campaign id used in our web app, allows you to create a link directly to it string title Title of the campaign string type The type of campaign this is (regular,plaintext,absplit,rss,inspection,trans,auto) date create_time Creation time for the campaign date send_time Send time for the campaign - also the scheduled time for scheduled campaigns. integer emails_sent Number of emails email was sent to string status Status of the given campaign (save,paused,schedule,sending,sent) string from_name From name of the given campaign string from_email Reply-to email of the given campaign string subject Subject of the given campaign string to_email Custom "To:" email string using merge variables string archive_url Archive link for the given campaign boolean inline_css Whether or not the campaigns content auto-css-lined string analytics Either "google" if enabled or "N" if disabled string analytics_tag The name/tag the campaign's links were tagged with if analytics were enabled. boolean track_clicks_text Whether or not links in the text version of the campaign were tracked boolean track_clicks_html Whether or not links in the html version of the campaign were tracked boolean track_opens Whether or not opens for the campaign were tracked string segment_text a string marked-up with HTML explaining the segment used for the campaign in plain English array segment_opts the segment used for the campaign - can be passed to campaignSegmentTest() or campaignCreate() - <?php
- /**
- This Example shows how to retrieve a list of your campaigns via the MCAPI class.
- **/
- require_once 'inc/MCAPI.class.php';
- require_once 'inc/config.inc.php'; //contains apikey
- $retval = $api->campaigns();
- if ($api->errorCode){
- } else {
- foreach($retval as $c){
- }
- }
- <?php
- /**
- This Example shows how to pull a list of Campaigns on your account using XML-RPC
- Note that we are using the PEAR XML-RPC2 client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.inc.php';
- try {
- $result = $client->campaigns($apikey);
- foreach($result as $c){
- }
- } catch (XML_RPC2_FaultException $e){
- }
Examples (2)
download example code[1] mcapi_campaigns.php
[2] xml-rpc_campaigns.php
|
Add New Note
User Contributed Notes for
campaigns |
|---|
| No notes, yet... Will you be the first?? |