-
Notifications
You must be signed in to change notification settings - Fork 0
MCAPI
- Class name: MCAPI
- Namespace:
public mixed $version = "1.3"
- Visibility: public
public mixed $errorMessage
- Visibility: public
public mixed $errorCode
- Visibility: public
public mixed $apiUrl
Cache the information on the API location on the server
- Visibility: public
public mixed $timeout = 300
Default to a 300 second timeout on server calls
- Visibility: public
public mixed $chunkSize = 8192
Default to a 8K chunk size
- Visibility: public
public mixed $api_key
Cache the user api_key so we only have to log in once per client instantiation
- Visibility: public
public mixed $secure = false
Cache the user api_key so we only have to log in once per client instantiation
- Visibility: public
mixed MCAPI::MCAPI(string $apikey, string $secure)
Connect to the MailChimp API for a given list.
- Visibility: public
- $apikey string - <p>Your MailChimp apikey</p>
- $secure string - <p>Whether or not this should use a secure connection</p>
mixed MCAPI::setTimeout($seconds)
- Visibility: public
- $seconds mixed
mixed MCAPI::getTimeout()
- Visibility: public
mixed MCAPI::useSecure($val)
- Visibility: public
- $val mixed
boolean MCAPI::campaignUnschedule(string $cid)
Unschedule a campaign that is scheduled to be sent in the future
- Visibility: public
- $cid string - <p>the id of the campaign to unschedule</p>
boolean MCAPI::campaignSchedule(string $cid, string $schedule_time, string $schedule_time_b)
Schedule a campaign to be sent in the future
- Visibility: public
- $cid string - <p>the id of the campaign to schedule</p>
- $schedule_time string - <p>the time to schedule the campaign. For A/B Split "schedule" campaigns, the time for Group A - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"</p>
- $schedule_time_b string - <p>optional -the time to schedule Group B of an A/B Split "schedule" campaign - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"</p>
boolean MCAPI::campaignScheduleBatch(string $cid, string $schedule_time, integer $num_batches, integer $stagger_mins)
Schedule a campaign to be sent in batches sometime in the future. Only valid for "regular" campaigns
- Visibility: public
- $cid string - <p>the id of the campaign to schedule</p>
- $schedule_time string - <p>the time to schedule the campaign.</p>
- $num_batches integer - <p>optional - the number of batches between 2 and 26 to send. defaults to 2</p>
- $stagger_mins integer - <p>optional - the number of minutes between each batch - 5, 10, 15, 20, 25, 30, or 60. defaults to 5</p>
boolean MCAPI::campaignResume(string $cid)
Resume sending an AutoResponder or RSS campaign
- Visibility: public
- $cid string - <p>the id of the campaign to pause</p>
boolean MCAPI::campaignPause(string $cid)
Pause an AutoResponder or RSS campaign from sending
- Visibility: public
- $cid string - <p>the id of the campaign to pause</p>
boolean MCAPI::campaignSendNow(string $cid)
Send a given campaign immediately. For RSS campaigns, this will "start" them.
- Visibility: public
- $cid string - <p>the id of the campaign to send</p>
boolean MCAPI::campaignSendTest(string $cid, array $test_emails, string $send_type)
Send a test of this campaign to the provided email address
- Visibility: public
- $cid string - <p>the id of the campaign to test</p>
- $test_emails array - <p>an array of email address to receive the test message</p>
- $send_type string - <p>optional by default (null) both formats are sent - "html" or "text" send just that format</p>
integer MCAPI::campaignSegmentTest(string $list_id, array $options)
Allows one to test their segmentation rules before creating a campaign using them
- Visibility: public
- $list_id string - <p>the list to test segmentation on - get lists using lists()</p>
- $options array - <p>with 2 keys: string "match" controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND) array "conditions" - up to 10 different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:</p> <p>Field = "<strong>date</strong>" : Select based on signup date Valid Op(eration): <strong>eq</strong> (is) / <strong>gt</strong> (after) / <strong>lt</strong> (before) Valid Values: string last_campaign_sent uses the date of the last campaign sent string campaign_id uses the send date of the campaign that carriers the Id submitted - see campaigns() string YYYY-MM-DD any date in the form of YYYY-MM-DD - <em>note:</em> anything that appears to start with YYYY will be treated as a date</p> <p>Field = "<strong>last_changed</strong>" : Select based on subscriber record last changed date Valid Op(eration): <strong>eq</strong> (is) / <strong>gt</strong> (after) / <strong>lt</strong> (before) Valid Values: string last_campaign_sent uses the date of the last campaign sent string campaign_id uses the send date of the campaign that carriers the Id submitted - see campaigns() string YYYY-MM-DD any date in the form of YYYY-MM-DD - <em>note:</em> anything that appears to start with YYYY will be treated as a date</p> <p>Field = "<strong>interests-X</strong>": where X is the Grouping Id from listInterestGroupings() Valid Op(erations): <strong>one</strong> / <strong>none</strong> / <strong>all</strong> Valid Values: a comma delimited string of interest groups for the list, just like you'd use in listSubscribe() - see listInterestGroupings()</p> <p>Field = "<strong>mc_language</strong>": Select subscribers based on their set/auto-detected language Valid Op(eration): <strong>eq</strong> (=) / <strong>ne</strong> (!=) Valid Values: a case sensitive language code from <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_new">here</a>.</p> <p>Field = "<strong>aim</strong>" Valid Op(erations): <strong>open</strong> / <strong>noopen</strong> / <strong>click</strong> / <strong>noclick</strong> Valid Values: "<strong>any</strong>" or a valid AIM-enabled Campaign that has been sent</p> <p>Field = "<strong>rating</strong>" : allows matching based on list member ratings Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (>) / <strong>lt</strong> (<) Valid Values: a number between 0 and 5</p> <p>Field = "<strong>ecomm_prod</strong>" or "<strong>ecomm_prod</strong>": allows matching product and category names from purchases Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (>) / <strong>lt</strong> (<) / <strong>like</strong> (like '%blah%') / <strong>nlike</strong> (not like '%blah%') / <strong>starts</strong> (like 'blah%') / <strong>ends</strong> (like '%blah') Valid Values: any string</p> <p>Field = "<strong>ecomm_spent_one</strong>" or "<strong>ecomm_spent_all</strong>" : allows matching purchase amounts on a single order or all orders Valid Op(erations): <strong>gt</strong> (>) / <strong>lt</strong> (<) Valid Values: a number</p> <p>Field = "<strong>ecomm_date</strong>" : allow matching based on order dates Valid Op(eration): <strong>eq</strong> (is) / <strong>gt</strong> (after) / <strong>lt</strong> (before) Valid Values: string last_campaign_sent uses the date of the last campaign sent string campaign_id uses the send date of the campaign that carriers the Id submitted - see campaigns() string YYYY-MM-DD any date in the form of YYYY-MM-DD - <em>note:</em> anything that appears to start with YYYY will be treated as a date</p> <p>Field = "<strong>social_gender</strong>" : allows matching against the gender acquired from SocialPro Valid Op(eration): <strong>eq</strong> (is) / <strong>ne</strong> (is not) Valid Values: male, female</p> <p>Field = "<strong>social_age</strong>" : allows matching against the age acquired from SocialPro Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (>) / <strong>lt</strong> (<) Valid Values: any number</p> <p>Field = "<strong>social_influence</strong>" : allows matching against the influence acquired from SocialPro Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (>) / <strong>lt</strong> (<) Valid Values: a number between 0 and 5</p> <p>Field = "<strong>social_network</strong>" : Valid Op(erations): <strong>member</strong> (is a member of) / <strong>notmember</strong> (is not a member of) Valid Values: twitter, facebook, myspace, linkedin, flickr</p> <p>Field = "<strong>static_segment</strong>" : Valid Op(erations): <strong>eq</strong> (is in) / <strong>ne</strong> (is not in) Valid Values: an int get from listStaticSegments()</p> <p>Field = "<strong>default_location</strong>" : the location we automatically assign to a subscriber based on where we've seen their activity originate Valid Op(erations): <strong>ipgeostate</strong> (within a US state) / <strong>ipgeonotstate</strong> (not within a US state) / <strong>ipgeocountry</strong> (within a country) / <strong>ipgeonotcountry</strong> (not within a country) / <strong>ipgeoin</strong> (within lat/lng parameters) / <strong>ipgeonotin</strong> (not within lat/lng parameters) Valid Values: string ipgeostate/ipgeonotstate a full US state name (not case sensitive) string ipgeocountry/ipgeonotcountry an ISO3166 2 digit country code (not case sensitive) int ipgeoin/ipgeonotin a distance in miles centered around a point you must specify by also passing <strong>lat</strong> (latitude) and <strong>lng</strong> (longitude) parameters</p> <p>Field = A <strong>Birthday</strong> type Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars(). Note, Brithday fields can <strong>only</strong> use the operations listed here. Valid Op(erations): <strong>eq</strong> (=) / <strong>starts</strong> (month equals) / <strong>ends</strong> (day equals) Valid Values: Any valid number for the operation being checked.</p> <p>Field = A <strong>Zip</strong> type Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars(). Note, Zip fields can <strong>only</strong> use the operations listed here. Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>geoin</strong> (US only) Valid Values: For <strong>eq</strong> (=) / <strong>ne</strong>, a Zip Code. For <strong>geoin</strong>, a radius in miles Extra Value: Only for <strong>geoin</strong> - the Zip Code to be used as the center point</p> <p>Field = An <strong>Address</strong> type Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars(). Note, Address fields can <strong>only</strong> use the operations listed here. Valid Op(erations): <strong>like</strong> (like '%blah%') / <strong>nlike</strong> (not like '%blah%') / <strong>geoin</strong> Valid Values: For <strong>like</strong> and <strong>nlike</strong>, a string. For <strong>geoin</strong>, a radius in miles Extra Value: Only for <strong>geoin</strong> - the Zip Code to be used as the center point</p> <p>Field = A <strong>Number</strong> type Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars(). Note, Number fields can <strong>only</strong> use the operations listed here. Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (>) / <strong>lt</strong> (<) / Valid Values: Any valid number.</p> <p>Default Field = A Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars() Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (>) / <strong>lt</strong> (<) / <strong>like</strong> (like '%blah%') / <strong>nlike</strong> (not like '%blah%') / <strong>starts</strong> (like 'blah%') / <strong>ends</strong> (like '%blah') Valid Values: any string</p>
string MCAPI::campaignCreate(string $type, array $options, array $content, array $segment_opts, array $type_opts)
Create a new draft campaign to send. You can not have more than 32,000 campaigns in your account.
- Visibility: public
- $type string - <p>the Campaign Type to create - one of "regular", "plaintext", "absplit", "rss", "auto"</p>
- $options array - <p>a hash of the standard options for this campaign : string list_id the list to send this campaign to- get lists using lists() string subject the subject line for your campaign message string from_email the From: email address for your campaign message string from_name the From: name for your campaign message (not an email address) string to_name the To: name recipients will see (not email address) int template_id optional - use this user-created template to generate the HTML content of the campaign (takes precendence over other template options) int gallery_template_id optional - use a template from the public gallery to generate the HTML content of the campaign (takes precendence over base template options) int base_template_id optional - use this a base/start-from-scratch template to generate the HTML content of the campaign int folder_id optional - automatically file the new campaign in the folder_id passed. Get using folders() - note that Campaigns and Autoresponders have separate folder setupsn array tracking optional - set which recipient actions will be tracked, as a struct of boolean values with the following keys: "opens", "html_clicks", and "text_clicks". By default, opens and HTML clicks will be tracked. Click tracking can not be disabled for Free accounts. string title optional - an internal name to use for this campaign. By default, the campaign subject will be used. boolean authenticate optional - set to true to enable SenderID, DomainKeys, and DKIM authentication, defaults to false. array analytics optional - if provided, use a struct with "service type" as a key and the "service tag" as a value. Use "google" for Google Analytics, "clicktale" for ClickTale, and "gooal" for Goo.al tracking. The "tag" is any custom text (up to 50 characters) that should be included. boolean auto_footer optional Whether or not we should auto-generate the footer for your content. Mostly useful for content from URLs or Imports boolean inline_css optional Whether or not css should be automatically inlined when this campaign is sent, defaults to false. boolean generate_text optional Whether of not to auto-generate your Text content from the HTML content. Note that this will be ignored if the Text part of the content passed is not empty, defaults to false. boolean auto_tweet optional If set, this campaign will be auto-tweeted when it is sent - defaults to false. Note that if a Twitter account isn't linked, this will be silently ignored. array auto_fb_post optional If set, this campaign will be auto-posted to the page_ids contained in the array. If a Facebook account isn't linked or the account does not have permission to post to the page_ids requested, those failures will be silently ignored. boolean fb_comments optional If true, the Facebook comments (and thus the <a href="http://kb.mailchimp.com/article/i-dont-want-an-archiave-of-my-campaign-can-i-turn-it-off/" target="_blank">archive bar</a> will be displayed. If false, Facebook comments will not be enabled (does not imply no archive bar, see previous link). Defaults to "true". boolean timewarp optional If set, this campaign must be scheduled 24 hours in advance of sending - default to false. Only valid for "regular" campaigns and "absplit" campaigns that split on schedule_time. boolean ecomm360 optional If set, our <a href="http://www.mailchimp.com/blog/ecommerce-tracking-plugin/" target="_blank">Ecommerce360 tracking</a> will be enabled for links in the campaign array crm_tracking optional If set, enable CRM tracking for:<div style="padding-left:15px"><table> array salesforce optional Enable SalesForce push back<div style="padding-left:15px"><table> bool campaign optional - if true, create a Campaign object and update it with aggregate stats bool notes optional - if true, attempt to update Contact notes based on email address</table></div> array highrise optional Enable Highrise push back<div style="padding-left:15px"><table> bool campaign optional - if true, create a Kase object and update it with aggregate stats bool notes optional - if true, attempt to update Contact notes based on email address</table></div> array capsule optional Enable Capsule push back (only notes are supported)<div style="padding-left:15px"><table> bool notes optional - if true, attempt to update Contact notes based on email address</table></div></table></div></p>
- $content array - <p>the content for this campaign - use a struct with the following keys: string html for pasted HTML content string text for the plain-text version string url to have us pull in content from a URL. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well string archive to send a Base64 encoded archive file for us to import all media from. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well string archive_type optional - only necessary for the "archive" option. Supported formats are: zip, tar.gz, tar.bz2, tar, tgz, tbz . If not included, we will default to zip</p> <p>If you chose a template instead of pasting in your HTML content, then use "html_" followed by the template sections as keys - for example, use a key of "html_MAIN" to fill in the "MAIN" section of a template.</p>
- $segment_opts array - <p>optional - if you wish to do Segmentation with this campaign this array should contain: see campaignSegmentTest(). It's suggested that you test your options against campaignSegmentTest().</p>
- $type_opts array - <p>optional - For RSS Campaigns this, array should contain: string url the URL to pull RSS content from - it will be verified and must exist string schedule optional one of "daily", "weekly", "monthly" - defaults to "daily" string schedule_hour optional an hour between 0 and 24 - default to 4 (4am <em>local time</em>) - applies to all schedule types string schedule_weekday optional for "weekly" only, a number specifying the day of the week to send: 0 (Sunday) - 6 (Saturday) - defaults to 1 (Monday) string schedule_monthday optional for "monthly" only, a number specifying the day of the month to send (1 - 28) or "last" for the last day of a given month. Defaults to the 1st day of the month array days optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on<div style="padding-left:15px"><table> bool 1 optional Monday, defaults to true bool 2 optional Tuesday, defaults to true bool 3 optional Wednesday, defaults to true bool 4 optional Thursday, defaults to true bool 5 optional Friday, defaults to true bool 6 optional Saturday, defaults to true bool 7 optional Sunday, defaults to true</table></div></p> <p>For A/B Split campaigns, this array should contain: string split_test The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaignSchedule() separately! string pick_winner How the winner will be picked, one of: "opens" (by the open_rate), "clicks" (by the click rate), "manual" (you pick manually) int wait_units optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400. int wait_time optional the number of units to wait before auto-selecting a winner - defaults to 1, so if not set, a winner will be selected after 1 Day. int split_size optional this is a percentage of what size the Campaign's List plus any segmentation options results in. "schedule" type forces 50%, all others default to 10% string from_name_a optional sort of, required when split_test is "from_name" string from_name_b optional sort of, required when split_test is "from_name" string from_email_a optional sort of, required when split_test is "from_name" string from_email_b optional sort of, required when split_test is "from_name" string subject_a optional sort of, required when split_test is "subject" string subject_b optional sort of, required when split_test is "subject"</p> <p>For AutoResponder campaigns, this array should contain: string offset-units one of "hourly", "day", "week", "month", "year" - required string offset-time optional, sort of - the number of units must be a number greater than 0 for signup based autoresponders, ignored for "hourly" string offset-dir either "before" or "after", ignored for "hourly" string event optional "signup" (default) to base this members added to a list, "date", "annual", or "birthday" to base this on merge field in the list, "campaignOpen" or "campaignClicka" to base this on any activity for a campaign, "campaignClicko" to base this on clicks on a specific URL in a campaign, "mergeChanged" to base this on a specific merge field being changed to a specific value string event-datemerge optional sort of, this is required if the event is "date", "annual", "birthday", or "mergeChanged" string campaign_id optional sort of, required for "campaignOpen", "campaignClicka", or "campaignClicko" string campaign_url optional sort of, required for "campaignClicko" int schedule_hour The hour of the day - 24 hour format in GMT - the autoresponder should be triggered, ignored for "hourly" boolean use_import_time whether or not imported subscribers (ie, <em>any</em> non-double optin subscribers) will receive array days optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on<div style="padding-left:15px"><table> bool 1 optional Monday, defaults to true bool 2 optional Tuesday, defaults to true bool 3 optional Wednesday, defaults to true bool 4 optional Thursday, defaults to true bool 5 optional Friday, defaults to true bool 6 optional Saturday, defaults to true bool 7 optional Sunday, defaults to true</table></div></p>
boolean MCAPI::campaignUpdate(string $cid, string $name, mixed $value)
Update just about any setting for a campaign that has not been sent. See campaignCreate() for details.
Caveats:
- If you set list_id, all segmentation options will be deleted and must be re-added.
- If you set template_id, you need to follow that up by setting it's 'content'
- If you set segment_opts, you should have tested your options against campaignSegmentTest() as campaignUpdate() will not allow you to set a segment that includes no members.
- To clear/unset segment_opts, pass an empty string or array as the value. Various wrappers may require one or the other.
- Visibility: public
- $cid string - <p>the Campaign Id to update</p>
- $name string - <p>the parameter name ( see campaignCreate() ). For items in the <strong>options</strong> array, this will be that parameter's name (subject, from_email, etc.). Additional parameters will be that option name (content, segment_opts). "type_opts" will be the name of the type - rss, auto, etc.</p>
- $value mixed - <p>an appropriate value for the parameter ( see campaignCreate() ). For items in the <strong>options</strong> array, this will be that parameter's value. For additional parameters, this is the same value passed to them.</p>
string MCAPI::campaignReplicate(string $cid)
Replicate a campaign.
- Visibility: public
- $cid string - <p>the Campaign Id to replicate</p>
boolean MCAPI::campaignDelete(string $cid)
Delete a campaign. Seriously, "poof, gone!" - be careful!
- Visibility: public
- $cid string - <p>the Campaign Id to delete</p>
array MCAPI::campaigns(array $filters, integer $start, integer $limit, $sort_field, $sort_dir)
Get the list of campaigns and their details matching the specified filters
- Visibility: public
- $filters array - <p>a hash of filters to apply to this query - all are optional: string campaign_id optional - return the campaign using a know campaign_id. Accepts multiples separated by commas when not using exact matching. string parent_id optional - return the child campaigns using a known parent campaign_id. Accepts multiples separated by commas when not using exact matching. string list_id optional - the list to send this campaign to - get lists using lists(). Accepts multiples separated by commas when not using exact matching. int folder_id optional - only show campaigns from this folder id - get folders using campaignFolders(). Accepts multiples separated by commas when not using exact matching. int template_id optional - only show campaigns using this template id - get templates using templates(). Accepts multiples separated by commas when not using exact matching. string status optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending". Accepts multiples separated by commas when not using exact matching. string type optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "auto". Accepts multiples separated by commas when not using exact matching. 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) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" string sendtime_end optional - only show campaigns that have been sent before this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" boolean uses_segment - whether to return just campaigns with or without segments boolean exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true. Using this disables the use of any filters that accept multiples.</p>
- $start integer - <p>optional - control paging of campaigns, start results at this campaign #, defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional - control paging of campaigns, number of campaigns to return with each call, defaults to 25 (max=1000)</p>
- $sort_field mixed
- $sort_dir mixed
array MCAPI::campaignStats(string $cid)
Given a list and a campaign, get all the relevant campaign statistics (opens, bounces, clicks, etc.)
- Visibility: public
- $cid string - <p>the campaign id to pull stats for (can be gathered using campaigns())</p>
array MCAPI::campaignClickStats(string $cid)
Get an array of the urls being tracked, and their click counts for a given campaign
- Visibility: public
- $cid string - <p>the campaign id to pull stats for (can be gathered using campaigns())</p>
array MCAPI::campaignEmailDomainPerformance(string $cid)
Get the top 5 performing email domains for this campaign. Users want more than 5 should use campaign campaignEmailStatsAIM() or campaignEmailStatsAIMAll() and generate any additional stats they require.
- Visibility: public
- $cid string - <p>the campaign id to pull email domain performance for (can be gathered using campaigns())</p>
array MCAPI::campaignMembers(string $cid, string $status, integer $start, integer $limit)
Get all email addresses the campaign was sent to
- Visibility: public
- $cid string - <p>the campaign id to pull members for (can be gathered using campaigns())</p>
- $status string - <p>optional the status to pull - one of 'sent', 'hard' (bounce), or 'soft' (bounce). By default, all records are returned</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000</p>
array MCAPI::campaignHardBounces(string $cid, integer $start, integer $limit)
DEPRECATED Get all email addresses with Hard Bounces for a given campaign
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000</p>
array MCAPI::campaignSoftBounces(string $cid, integer $start, integer $limit)
DEPRECATED Get all email addresses with Soft Bounces for a given campaign
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000</p>
array MCAPI::campaignUnsubscribes(string $cid, integer $start, integer $limit)
Get all unsubscribed email addresses for a given campaign
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000</p>
array MCAPI::campaignAbuseReports(string $cid, string $since, integer $start, integer $limit)
Get all email addresses that complained about a given campaign
- Visibility: public
- $cid string - <p>the campaign id to pull abuse reports for (can be gathered using campaigns())</p>
- $since string - <p>optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 500, upper limit set at 1000</p>
array MCAPI::campaignAdvice(string $cid)
Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary
- Visibility: public
- $cid string - <p>the campaign id to pull advice text for (can be gathered using campaigns())</p>
array MCAPI::campaignAnalytics(string $cid)
Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
array MCAPI::campaignGeoOpens(string $cid)
Retrieve the countries and number of opens tracked for each. Email address are not returned.
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
array MCAPI::campaignGeoOpensForCountry(string $cid, string $code)
Retrieve the regions and number of opens tracked for a certain country. Email address are not returned.
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
- $code string - <p>An ISO3166 2 digit country code</p>
array MCAPI::campaignEepUrlStats(string $cid)
Retrieve the tracked eepurl mentions on Twitter
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
array MCAPI::campaignBounceMessage(string $cid, string $email)
Retrieve the most recent full bounce message for a specific email address on the given campaign.
Messages over 30 days old are subject to being removed
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
- $email string - <p>the email address or unique id of the member to pull a bounce message for.</p>
array MCAPI::campaignBounceMessages(string $cid, integer $start, integer $limit, string $since)
Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts of data depending on how large the campaign was and how much cruft the bounce provider returned. Also, message over 30 days old are subject to being removed
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 25, upper limit set at 50</p>
- $since string - <p>optional pull only messages since this time - use YYYY-MM-DD format in <strong>GMT</strong> (we only store the date, not the time)</p>
array MCAPI::campaignEcommOrders(string $cid, integer $start, integer $limit, string $since)
Retrieve the Ecommerce Orders tracked by campaignEcommOrderAdd()
- Visibility: public
- $cid string - <p>the campaign id to pull bounces for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 100, upper limit set at 500</p>
- $since string - <p>optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"</p>
array MCAPI::campaignShareReport(string $cid, array $opts)
Get the URL to a customized VIP Report for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password)
- Visibility: public
- $cid string - <p>the campaign id to share a report for (can be gathered using campaigns())</p>
- $opts array - <p>optional various parameters which can be used to configure the shared report string to_email optional - optional, comma delimited list of email addresses to share the report with - no value means an email will not be sent string company optional - a company name to be displayed (use of a theme may hide this) - max 255 bytes int theme_id optional - either a global or a user-specific theme id. Currently this needs to be pulled out of either the Share Report or Cobranding web views by grabbing the "theme" attribute from the list presented. string css_url optional - a link to an external CSS file to be included after our default CSS (<a href="http://vip-reports.net/css/vip.css">http://vip-reports.net/css/vip.css</a>) <strong>only if</strong> loaded via the "secure_url" - max 255 bytes</p>
array MCAPI::campaignContent(string $cid, boolean $for_archive)
Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content
- Visibility: public
- $cid string - <p>the campaign id to get content for (can be gathered using campaigns())</p>
- $for_archive boolean - <p>optional controls whether we return the Archive version (true) or the Raw version (false), defaults to true</p>
array MCAPI::campaignTemplateContent(string $cid)
Get the HTML template content sections for a campaign. Note that this will return very jagged, non-standard results based on the template a campaign is using. You only want to use this if you want to allow editing template sections in your applicaton.
- Visibility: public
- $cid string - <p>the campaign id to get content for (can be gathered using campaigns())</p>
array MCAPI::campaignOpenedAIM(string $cid, integer $start, integer $limit)
Retrieve the list of email addresses that opened a given campaign with how many times they opened
- Visibility: public
- $cid string - <p>the campaign id to get opens for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000</p>
array MCAPI::campaignNotOpenedAIM(string $cid, integer $start, integer $limit)
Retrieve the list of email addresses that did not open a given campaign
- Visibility: public
- $cid string - <p>the campaign id to get no opens for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000</p>
array MCAPI::campaignClickDetailAIM(string $cid, string $url, integer $start, integer $limit)
Return the list of email addresses that clicked on a given url, and how many times they clicked
- Visibility: public
- $cid string - <p>the campaign id to get click stats for (can be gathered using campaigns())</p>
- $url string - <p>the URL of the link that was clicked on</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000</p>
array MCAPI::campaignEmailStatsAIM(string $cid, array $email_address)
Given a campaign and email address, return the entire click and open history with timestamps, ordered by time
- Visibility: public
- $cid string - <p>the campaign id to get stats for (can be gathered using campaigns())</p>
- $email_address array - <p>an array of up to 50 email addresses to check OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns. For backwards compatibility, if a string is passed, it will be treated as an array with a single element (will not work with XML-RPC).</p>
array MCAPI::campaignEmailStatsAIMAll(string $cid, integer $start, integer $limit)
Given a campaign and correct paging limits, return the entire click and open history with timestamps, ordered by time, for every user a campaign was delivered to.
- Visibility: public
- $cid string - <p>the campaign id to get stats for (can be gathered using campaigns())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 100, upper limit set at 1000</p>
boolean MCAPI::campaignEcommOrderAdd(array $order)
Attach Ecommerce Order Information to a Campaign. This will generally be used by ecommerce package plugins provided by us or by 3rd part system developers.
- Visibility: public
- $order array - <p>an array of information pertaining to the order that has completed. Use the following keys: string id the Order Id string campaign_id the Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes) string email_id the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) double total The Order Total (ie, the full amount the customer ends up paying) string order_date optional the date of the order - if this is not provided, we will default the date to now double shipping optional the total paid for Shipping Fees double tax optional the total tax paid string store_id a unique id for the store sending the order in (20 bytes max) string store_name optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id) array items the individual line items for an order using these keys:</p> <div style="padding-left:30px"><table> int line_num optional the line number of the item on the order. We will generate these if they are not passed int product_id the store's internal Id for the product. Lines that do no contain this will be skipped string sku optional the store's internal SKU for the product. (max 30 bytes) string product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id) int category_id the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario string category_name the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc. double qty the quantity of the item ordered double cost the cost of a single item (ie, not the extended cost of the line) </table></div>
array MCAPI::lists(array $filters, integer $start, integer $limit, $sort_field, $sort_dir)
Retrieve all of the lists defined for your user account
- Visibility: public
- $filters array - <p>a hash of filters to apply to this query - all are optional: string list_id optional - return a single list using a known list_id. Accepts multiples separated by commas when not using exact matching string list_name optional - only lists that match this name string from_name optional - only lists that have a default from name matching this string from_email optional - only lists that have a default from email matching this string from_subject optional - only lists that have a default from email matching this string created_before optional - only show lists that were created before this date/time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" string created_after optional - only show lists that were created since this date/time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" boolean exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true</p>
- $start integer - <p>optional - control paging of lists, start results at this list #, defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional - control paging of lists, number of lists to return with each call, defaults to 25 (max=100)</p>
- $sort_field mixed
- $sort_dir mixed
array MCAPI::listMergeVars(string $id)
Get the list of merge tags for a given list, including their name, tag, and required setting
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
boolean MCAPI::listMergeVarAdd(string $id, string $tag, string $name, array $options)
Add a new merge tag to a given list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $tag string - <p>The merge tag to add, e.g. FNAME. 10 bytes max, valid characters: "A-Z 0-9 _" no spaces, dashes, etc.</p>
- $name string - <p>The long description of the tag being added, used for user displays</p>
- $options array - <p>optional Various options for this merge var. <em>note:</em> for historical purposes this can also take a "boolean" string field_type optional one of: text, number, radio, dropdown, date, address, phone, url, imageurl, zip, birthday - defaults to text boolean req optional indicates whether the field is required - defaults to false boolean public optional indicates whether the field is displayed in public - defaults to true boolean show optional indicates whether the field is displayed in the app's list member view - defaults to true int order The order this merge tag should be displayed in - this will cause existing values to be reset so this fits string default_value optional the default value for the field. See listSubscribe() for formatting info. Defaults to blank array choices optional kind of - an array of strings to use as the choices for radio and dropdown type fields string dateformat optional only valid for birthday and date fields. For birthday type, must be "MM/DD" (default) or "DD/MM". For date type, must be "MM/DD/YYYY" (default) or "DD/MM/YYYY". Any other values will be converted to the default. string phoneformat optional "US" is the default - any other value will cause them to be unformatted (international) string defaultcountry optional the <a href="http://www.iso.org/iso/english_country_names_and_code_elements" target="_blank">ISO 3166 2 digit character code</a> for the default country. Defaults to "US". Anything unrecognized will be converted to the default.</p>
boolean MCAPI::listMergeVarUpdate(string $id, string $tag, array $options)
Update most parameters for a merge tag on a given list. You cannot currently change the merge type
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $tag string - <p>The merge tag to update</p>
- $options array - <p>The options to change for a merge var. See listMergeVarAdd() for valid options. "tag" and "name" may also be used here.</p>
boolean MCAPI::listMergeVarDel(string $id, string $tag)
Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well! Note that on large lists this method may seem a bit slower than calls you typically make.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $tag string - <p>The merge tag to delete</p>
boolean MCAPI::listMergeVarReset(string $id, string $tag)
Completely resets all data stored in a merge var on a list. All data is removed and this action can not be undone.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $tag string - <p>The merge tag to reset</p>
\struct MCAPI::listInterestGroupings(string $id)
Get the list of interest groupings for a given list, including the label, form information, and included groups for each
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
boolean MCAPI::listInterestGroupAdd(string $id, string $group_name, integer $grouping_id)
Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first group will automatically turn them on.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $group_name string - <p>the interest group to add - group names must be unique within a grouping</p>
- $grouping_id integer - <p>optional The grouping to add the new group to - get using listInterestGrouping() . If not supplied, the first grouping on the list is used.</p>
boolean MCAPI::listInterestGroupDel(string $id, string $group_name, integer $grouping_id)
Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $group_name string - <p>the interest group to delete</p>
- $grouping_id integer - <p>The grouping to delete the group from - get using listInterestGrouping() . If not supplied, the first grouping on the list is used.</p>
boolean MCAPI::listInterestGroupUpdate(string $id, string $old_name, string $new_name, integer $grouping_id)
Change the name of an Interest Group
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $old_name string - <p>the interest group name to be changed</p>
- $new_name string - <p>the new interest group name to be set</p>
- $grouping_id integer - <p>optional The grouping to delete the group from - get using listInterestGrouping() . If not supplied, the first grouping on the list is used.</p>
integer MCAPI::listInterestGroupingAdd(string $id, string $name, string $type, array $groups)
Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first grouping will automatically turn them on.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $name string - <p>the interest grouping to add - grouping names must be unique</p>
- $type string - <p>The type of the grouping to add - one of "checkboxes", "hidden", "dropdown", "radio"</p>
- $groups array - <p>The lists of initial group names to be added - at least 1 is required and the names must be unique within a grouping. If the number takes you over the 60 group limit, an error will be thrown.</p>
boolean MCAPI::listInterestGroupingUpdate(integer $grouping_id, string $name, string $value)
Update an existing Interest Grouping
- Visibility: public
- $grouping_id integer - <p>the interest grouping id - get from listInterestGroupings()</p>
- $name string - <p>The name of the field to update - either "name" or "type". Groups with in the grouping should be manipulated using the standard listInterestGroup* methods</p>
- $value string - <p>The new value of the field. Grouping names must be unique - only "hidden" and "checkboxes" grouping types can be converted between each other.</p>
boolean MCAPI::listInterestGroupingDel(integer $grouping_id)
Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members
- Visibility: public
- $grouping_id integer - <p>the interest grouping id - get from listInterestGroupings()</p>
array MCAPI::listWebhooks(string $id)
Return the Webhooks configured for the given list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
boolean MCAPI::listWebhookAdd(string $id, string $url, array $actions, array $sources)
Add a new Webhook URL for the given list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $url string - <p>a valid URL for the Webhook - it will be validated. note that a url may only exist on a list once.</p>
- $actions array - <p>optional a hash of actions to fire this Webhook for bool subscribe optional as subscribes occur, defaults to true bool unsubscribe optional as subscribes occur, defaults to true bool profile optional as profile updates occur, defaults to true bool cleaned optional as emails are cleaned from the list, defaults to true bool upemail optional when subscribers change their email address, defaults to true bool campaign option when a campaign is sent or canceled, defaults to true</p>
- $sources array - <p>optional a hash of sources to fire this Webhook for bool user optional user/subscriber initiated actions, defaults to true bool admin optional admin actions in our web app, defaults to true bool api optional actions that happen via API calls, defaults to false</p>
boolean MCAPI::listWebhookDel(string $id, string $url)
Delete an existing Webhook URL from a given list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $url string - <p>the URL of a Webhook on this list</p>
array MCAPI::listStaticSegments(string $id)
Retrieve all of the Static Segments for a list.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
integer MCAPI::listStaticSegmentAdd(string $id, string $name)
Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments are not tied to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation options), though performance may degrade at that point.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $name string - <p>a unique name per list for the segment - 50 byte maximum length, anything longer will throw an error</p>
boolean MCAPI::listStaticSegmentReset(string $id, integer $seg_id)
Resets a static segment - removes all members from the static segment. Note: does not actually affect list member data
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $seg_id integer - <p>the id of the static segment to reset - get from listStaticSegments()</p>
boolean MCAPI::listStaticSegmentDel(string $id, integer $seg_id)
Delete a static segment. Note that this will, of course, remove any member affiliations with the segment
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $seg_id integer - <p>the id of the static segment to delete - get from listStaticSegments()</p>
array MCAPI::listStaticSegmentMembersAdd(string $id, integer $seg_id, array $batch)
Add list members to a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list in order to be included - this will not subscribe them to the list!
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $seg_id integer - <p>the id of the static segment to modify - get from listStaticSegments()</p>
- $batch array - <p>an array of email addresses and/or unique_ids to add to the segment</p>
array MCAPI::listStaticSegmentMembersDel(string $id, integer $seg_id, array $batch)
Remove list members from a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list in order to be removed - this will not unsubscribe them from the list!
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $seg_id integer - <p>the id of the static segment to delete - get from listStaticSegments()</p>
- $batch array - <p>an array of email addresses and/or unique_ids to remove from the segment</p>
boolean MCAPI::listSubscribe(string $id, string $email_address, array $merge_vars, string $email_type, boolean $double_optin, boolean $update_existing, boolean $replace_interests, boolean $send_welcome)
Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked!
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $email_address string - <p>the email address to subscribe</p>
- $merge_vars array - <p>optional merges for the email (FNAME, LNAME, etc.) (see examples below for handling "blank" arrays). Note that a merge field can only hold up to 255 bytes. Also, there are a few "special" keys: string EMAIL set this to change the email address. This is only respected on calls using update_existing or when passed to listUpdateMember() string NEW-EMAIL set this to change the email address. This is only respected on calls using update_existing or when passed to listUpdateMember(). Required to change via listBatchSubscribe() - EMAIL takes precedence on other calls, though either will work. array GROUPINGS Set Interest Groups by Grouping. Each element in this array should be an array containing the "groups" parameter which contains a comma delimited list of Interest Groups to add. Commas in Interest Group names should be escaped with a backslash. ie, "," => "," and either an "id" or "name" parameter to specify the Grouping - get from listInterestGroupings() string OPTIN_IP Set the Opt-in IP field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must not be a private IP address. string OPTIN_TIME Set the Opt-in Time field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must be a valid date. Use - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" to be safe. Generally, though, anything strtotime() understands we'll understand - <a href="http://us2.php.net/strtotime" target="_blank"><a href="http://us2.php.net/strtotime">http://us2.php.net/strtotime</a></a> array MC_LOCATION Set the member's geographic location. By default if this merge field exists, we'll update using the optin_ip if it exists. If the array contains LATITUDE and LONGITUDE keys, they will be used. NOTE - this will slow down each subscribe call a bit, especially for lat/lng pairs in sparsely populated areas. Currently our automated background processes can and will overwrite this based on opens and clicks. string MC_LANGUAGE Set the member's language preference. Supported codes are fully case-sensitive and can be found <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_new">here</a>. array MC_NOTES Add, update, or delete notes associated with a member. The array must contain either a "note" key (the note to set) or an "id" key (the note id to modify). If the "id" key exists and is valid, an "update" key may be set to "append" (default), "prepend", "replace", or "delete" to handle how we should update existing notes. If a "note" key is passed and the "id" key is not passed or is not valid, a new note will be added. "delete", obviously, will only work with a valid "id" - passing that along with "note" and an invalid "id" is wrong and will be ignored. If this is not an array, it will silently be ignored.</p> <p><strong>Handling Field Data Types</strong> - most fields you can just pass a string and all is well. For some, though, that is not the case... Field values should be formatted as follows: string address For the string version of an Address, the fields should be delimited by <strong>2</strong> spaces. Address 2 can be skipped. The Country should be a 2 character ISO-3166-1 code and will default to your default country if not set array address For the array version of an Address, the requirements for Address 2 and Country are the same as with the string version. Then simply pass us an array with the keys <strong>addr1</strong>, <strong>addr2</strong>, <strong>city</strong>, <strong>state</strong>, <strong>zip</strong>, <strong>country</strong> and appropriate values for each</p> <p>string birthday the month and day of birth, passed as MM/DD array birthday the month and day of birth, passed in an array using the keys <strong>month</strong> and <strong>day</strong></p> <p>string date use YYYY-MM-DD to be safe. Generally, though, anything strtotime() understands we'll understand - <a href="http://us2.php.net/strtotime" target="_blank"><a href="http://us2.php.net/strtotime">http://us2.php.net/strtotime</a></a> string dropdown can be a normal string - we <em>will</em> validate that the value is a valid option string image must be a valid, existing url. we <em>will</em> check its existence string multi_choice can be a normal string - we <em>will</em> validate that the value is a valid option double number pass in a valid number - anything else will turn in to zero (0). Note, this will be rounded to 2 decimal places string phone If your account has the US Phone numbers option set, this <em>must</em> be in the form of NPA-NXX-LINE (404-555-1212). If not, we assume an International number and will simply set the field with what ever number is passed in. string website This is a standard string, but we <em>will</em> verify that it looks like a valid URL string zip A U.S. zip code. We'll validate this is a 4 or 5 digit number.</p>
- $email_type string - <p>optional email type preference for the email (html or text - defaults to html)</p>
- $double_optin boolean - <p>optional flag to control whether a double opt-in confirmation message is sent, defaults to true. <em>Abusing this may cause your account to be suspended.</em></p>
- $update_existing boolean - <p>optional flag to control whether existing subscribers should be updated instead of throwing an error, defaults to false</p>
- $replace_interests boolean - <p>optional flag to determine whether we replace the interest groups with the groups provided or we add the provided groups to the member's interest groups (optional, defaults to true)</p>
- $send_welcome boolean - <p>optional if your double_optin is false and this is true, we will send your lists Welcome Email if this subscribe succeeds - this will <em>not</em> fire if we end up updating an existing subscriber. If double_optin is true, this has no effect. defaults to false.</p>
boolean MCAPI::listUnsubscribe(string $id, string $email_address, boolean $delete_member, boolean $send_goodbye, boolean $send_notify)
Unsubscribe the given email address from the list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $email_address string - <p>the email address to unsubscribe OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns</p>
- $delete_member boolean - <p>flag to completely delete the member from your list instead of just unsubscribing, default to false</p>
- $send_goodbye boolean - <p>flag to send the goodbye email to the email address, defaults to true</p>
- $send_notify boolean - <p>flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to true</p>
boolean MCAPI::listUpdateMember(string $id, string $email_address, array $merge_vars, string $email_type, boolean $replace_interests)
Edit the email address, merge fields, and interest groups for a list member. If you are doing a batch update on lots of users, consider using listBatchSubscribe() with the update_existing and possible replace_interests parameter.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $email_address string - <p>the current email address of the member to update OR the "id" for the member returned from listMemberInfo, Webhooks, and Campaigns</p>
- $merge_vars array - <p>array of new field values to update the member with. See merge_vars in listSubscribe() for details.</p>
- $email_type string - <p>change the email type preference for the member ("html" or "text"). Leave blank to keep the existing preference (optional)</p>
- $replace_interests boolean - <p>flag to determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)</p>
array MCAPI::listBatchSubscribe(string $id, array $batch, boolean $double_optin, boolean $update_existing, boolean $replace_interests)
Subscribe a batch of email addresses to a list at once. If you are using a serialized version of the API, we strongly suggest that you only run this method as a POST request, and not a GET request. Maximum batch sizes vary based on the amount of data in each record, though you should cap them at 5k - 10k records, depending on your experience. These calls are also long, so be sure you increase your timeout values.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $batch array - <p>an array of structs for each address to import with two special keys: "EMAIL" for the email address, and "EMAIL_TYPE" for the email type option (html or text). Aside from those, see listSubscribe() for other merge var options</p>
- $double_optin boolean - <p>flag to control whether to send an opt-in confirmation email - defaults to true</p>
- $update_existing boolean - <p>flag to control whether to update members that are already subscribed to the list or to return an error, defaults to false (return error)</p>
- $replace_interests boolean - <p>flag to determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)</p>
array MCAPI::listBatchUnsubscribe(string $id, array $emails, boolean $delete_member, boolean $send_goodbye, boolean $send_notify)
Unsubscribe a batch of email addresses to a list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $emails array - <p>array of email addresses to unsubscribe</p>
- $delete_member boolean - <p>flag to completely delete the member from your list instead of just unsubscribing, default to false</p>
- $send_goodbye boolean - <p>flag to send the goodbye email to the email addresses, defaults to true</p>
- $send_notify boolean - <p>flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to false</p>
array MCAPI::listMembers(string $id, string $status, string $since, integer $start, integer $limit, string $sort_dir)
Get all of the list members for a list that are of a particular status. Are you trying to get a dump including lots of merge data or specific members of a list? If so, checkout the Export API
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $status string - <p>the status to get members for - one of(subscribed, unsubscribed, <a target="_blank" href="http://eepurl.com/gWOO">cleaned</a>, updated), defaults to subscribed</p>
- $since string - <p>optional pull all members whose status (subscribed/unsubscribed/cleaned) has changed or whose profile (updated) has changed since this date/time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 100, upper limit set at 15000</p>
- $sort_dir string - <p>optional ASC for ascending, DESC for descending. defaults to ASC even if an invalid value is encountered.</p>
array MCAPI::listMemberInfo(string $id, array $email_address)
Get all the information for particular members of a list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $email_address array - <p>an array of up to 50 email addresses to get information for OR the "id"(s) for the member returned from listMembers, Webhooks, and Campaigns. For backwards compatibility, if a string is passed, it will be treated as an array with a single element (will not work with XML-RPC).</p>
array MCAPI::listMemberActivity(string $id, array $email_address)
Get the most recent 100 activities for particular list members (open, click, bounce, unsub, abuse, sent to)
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $email_address array - <p>an array of up to 50 email addresses to get information for OR the "id"(s) for the member returned from listMembers, Webhooks, and Campaigns.</p>
array MCAPI::listAbuseReports(string $id, integer $start, integer $limit, string $since)
Get all email addresses that complained about a given campaign
- Visibility: public
- $id string - <p>the list id to pull abuse reports for (can be gathered using lists())</p>
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 500, upper limit set at 1000</p>
- $since string - <p>optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"</p>
array MCAPI::listGrowthHistory(string $id)
Access the Growth History by Month for a given list.
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
array MCAPI::listActivity(string $id)
Access up to the previous 180 days of daily detailed aggregated activity stats for a given list
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
array MCAPI::listLocations(string $id)
Retrieve the locations (countries) that the list's subscribers have been tagged to based on geocoding their IP address
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
array MCAPI::listClients(string $id)
Retrieve the clients that the list's subscribers have been tagged as being used based on user agents seen. Made possible by user-agent-string.info
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
array MCAPI::templates(array $types, string $category, array $inactives)
Retrieve various templates available in the system, allowing some thing similar to our template gallery to be created.
- Visibility: public
- $types array - <p>optional the types of templates to return boolean user Custom templates for this user account. Defaults to true. boolean gallery Templates from our Gallery. Note that some templates that require extra configuration are withheld. (eg, the Etsy template). Defaults to false. boolean base Our "start from scratch" extremely basic templates. Defaults to false.</p>
- $category string - <p>optional for Gallery templates only, limit to a specific template category</p>
- $inactives array - <p>optional options to control how inactive templates are returned, if at all boolean include user templates are not deleted, only set inactive. defaults to false. boolean only only include inactive templates. defaults to false.</p>
array MCAPI::templateInfo(integer $tid, string $type)
Pull details for a specific template to help support editing
- Visibility: public
- $tid integer - <p>the template id - get from templates()</p>
- $type string - <p>optional the template type to load - one of 'user', 'gallery', 'base', defaults to user.</p>
integer MCAPI::templateAdd(string $name, string $html)
Create a new user template, NOT campaign content. These templates can then be applied while creating campaigns.
- Visibility: public
- $name string - <p>the name for the template - names must be unique and a max of 50 bytes</p>
- $html string - <p>a string specifying the entire template to be created. This is <strong>NOT</strong> campaign content. They are intended to utilize our <a href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">template language</a>.</p>
boolean MCAPI::templateUpdate(integer $id, array $values)
Replace the content of a user template, NOT campaign content.
- Visibility: public
- $id integer - <p>the id of the user template to update</p>
- $values array - <p>the values to updates - while both are optional, at least one should be provided. Both can be updated at the same time. string name optional the name for the template - names must be unique and a max of 50 bytes string html optional a string specifying the entire template to be created. This is <strong>NOT</strong> campaign content. They are intended to utilize our <a href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">template language</a>.</p>
boolean MCAPI::templateDel(integer $id)
Delete (deactivate) a user template
- Visibility: public
- $id integer - <p>the id of the user template to delete</p>
boolean MCAPI::templateUndel(integer $id)
Undelete (reactivate) a user template
- Visibility: public
- $id integer - <p>the id of the user template to reactivate</p>
array MCAPI::getAccountDetails(array $exclude)
Retrieve lots of account information including payments made, plan info, some account stats, installed modules, contact info, and more. No private information like Credit Card numbers is available.
- Visibility: public
- $exclude array - <p>optional defaults to nothing for backwards compatibility. Allows controlling which extra arrays are returned since they can slow down calls. Valid keys are "modules", "orders", "rewards-credits", "rewards-inspections", "rewards-referrals", and "rewards-applied". Hint: "rewards-referrals" is typically the culprit. To avoid confusion, if data is excluded, the corresponding key <strong>will not be returned at all</strong>.</p>
array MCAPI::getVerifiedDomains()
Retrieve all domains verification records for an account
- Visibility: public
string MCAPI::generateText(string $type, mixed $content)
Have HTML content auto-converted to a text-only format. You can send: plain HTML, an array of Template content, an existing Campaign Id, or an existing Template Id. Note that this will not save anything to or update any of your lists, campaigns, or templates.
- Visibility: public
- $type string - <p>The type of content to parse. Must be one of: "html", "template", "url", "cid" (Campaign Id), or "tid" (Template Id)</p>
- $content mixed - <p>The content to use. For "html" expects a single string value, "template" expects an array like you send to campaignCreate, "url" expects a valid & public URL to pull from, "cid" expects a valid Campaign Id, and "tid" expects a valid Template Id on your account.</p>
string MCAPI::inlineCss(string $html, boolean $strip_css)
Send your HTML content to have the CSS inlined and optionally remove the original styles.
- Visibility: public
- $html string - <p>Your HTML content</p>
- $strip_css boolean - <p>optional Whether you want the CSS < style> tags stripped from the returned document. Defaults to false.</p>
array MCAPI::folders(string $type)
List all the folders for a user account
- Visibility: public
- $type string - <p>optional the type of folders to return - either "campaign" or "autoresponder". Defaults to "campaign"</p>
integer MCAPI::folderAdd(string $name, string $type)
Add a new folder to file campaigns or autoresponders in
- Visibility: public
- $name string - <p>a unique name for a folder (max 100 bytes)</p>
- $type string - <p>optional the type of folder to create - either "campaign" or "autoresponder". Defaults to "campaign"</p>
boolean MCAPI::folderUpdate(integer $fid, string $name, string $type)
Update the name of a folder for campaigns or autoresponders
- Visibility: public
- $fid integer - <p>the folder id to update - retrieve from folders()</p>
- $name string - <p>a new, unique name for the folder (max 100 bytes)</p>
- $type string - <p>optional the type of folder to create - either "campaign" or "autoresponder". Defaults to "campaign"</p>
boolean MCAPI::folderDel(integer $fid, string $type)
Delete a campaign or autoresponder folder. Note that this will simply make campaigns in the folder appear unfiled, they are not removed.
- Visibility: public
- $fid integer - <p>the folder id to update - retrieve from folders()</p>
- $type string - <p>optional the type of folder to create - either "campaign" or "autoresponder". Defaults to "campaign"</p>
array MCAPI::ecommOrders(integer $start, integer $limit, string $since)
Retrieve the Ecommerce Orders for an account
- Visibility: public
- $start integer - <p>optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)</p>
- $limit integer - <p>optional for large data sets, the number of results to return - defaults to 100, upper limit set at 500</p>
- $since string - <p>optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"</p>
boolean MCAPI::ecommOrderAdd(array $order)
Import Ecommerce Order Information to be used for Segmentation. This will generally be used by ecommerce package plugins provided by us or by 3rd part system developers.
- Visibility: public
- $order array - <p>an array of information pertaining to the order that has completed. Use the following keys: string id the Order Id string email_id optional (kind of) the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) - either this or <strong>email</strong> is required. If both are provided, email_id takes precedence string email optional (kind of) the Email Address we should attach this order to - either this or <strong>email_id</strong> is required. If both are provided, email_id takes precedence double total The Order Total (ie, the full amount the customer ends up paying) string order_date optional the date of the order - if this is not provided, we will default the date to now double shipping optional the total paid for Shipping Fees double tax optional the total tax paid string store_id a unique id for the store sending the order in (20 bytes max) string store_name optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id) string campaign_id optional the Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes) array items the individual line items for an order using these keys:</p> <div style="padding-left:30px"><table> int line_num optional the line number of the item on the order. We will generate these if they are not passed int product_id the store's internal Id for the product. Lines that do no contain this will be skipped string sku optional the store's internal SKU for the product. (max 30 bytes) string product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id) int category_id the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario string category_name the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc. double qty optional the quantity of the item ordered - defaults to 1 double cost optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0 </table></div>
boolean MCAPI::ecommOrderDel(string $store_id, string $order_id)
Delete Ecommerce Order Information used for segmentation. This will generally be used by ecommerce package plugins that we provide or by 3rd part system developers.
- Visibility: public
- $store_id string - <p>the store id the order belongs to</p>
- $order_id string - <p>the order id (generated by the store) to delete</p>
array MCAPI::listsForEmail(string $email_address)
Retrieve all List Ids a member is subscribed to.
- Visibility: public
- $email_address string - <p>the email address to check OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns</p>
array MCAPI::campaignsForEmail(string $email_address, array $options)
Retrieve all Campaigns Ids a member was sent
- Visibility: public
- $email_address string - <p>the email address to unsubscribe OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns</p>
- $options array - <p>optional extra options to modify the returned data. string list_id optional A list_id to limit the campaigns to bool verbose optional Whether or not to return verbose data (beta - this will change the return format into something undocumented, but consistent). defaults to false</p>
array MCAPI::chimpChatter()
Return the current Chimp Chatter messages for an account.
- Visibility: public
array MCAPI::searchMembers(string $query, string $id, $offset)
Search account wide or on a specific list using the specified query terms
- Visibility: public
- $query string - <p>terms to search on, <a href="http://kb.mailchimp.com/article/i-cant-find-a-recipient-on-my-list" target="_blank">just like you do in the app</a></p>
- $id string - <p>optional the list id to limit the search to. Get by calling lists()</p>
- $offset mixed
array MCAPI::searchCampaigns(string $query, $offset, $snip_start, $snip_end)
Search all campaigns for the specified query terms
- Visibility: public
- $query string - <p>terms to search on</p>
- $offset mixed
- $snip_start mixed
- $snip_end mixed
array MCAPI::apikeys(string $username, string $password, boolean $expired)
Retrieve a list of all MailChimp API Keys for this User
- Visibility: public
- $username string - <p>Your MailChimp user name</p>
- $password string - <p>Your MailChimp password</p>
- $expired boolean - <p>optional - whether or not to include expired keys, defaults to false</p>
string MCAPI::apikeyAdd(string $username, string $password)
Add an API Key to your account. We will generate a new key for you and return it.
- Visibility: public
- $username string - <p>Your MailChimp user name</p>
- $password string - <p>Your MailChimp password</p>
boolean MCAPI::apikeyExpire(string $username, string $password)
Expire a Specific API Key. Note that if you expire all of your keys, just visit your API dashboard to create a new one. If you are trying to shut off access to your account for an old developer, change your MailChimp password, then expire all of the keys they had access to. Note that this takes effect immediately, so make sure you replace the keys in any working application before expiring them! Consider yourself warned.
..
- Visibility: public
- $username string - <p>Your MailChimp user name</p>
- $password string - <p>Your MailChimp password</p>
string MCAPI::ping()
"Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different string back that will explain our view on what is going on.
- Visibility: public
array MCAPI::deviceRegister(string $mobile_key, array $details)
Register a mobile device
- Visibility: public
- $mobile_key string - <p>a valid key identifying your mobile application.</p>
- $details array - <p>the details for the device registration</p>
array MCAPI::deviceUnregister(string $mobile_key, string $device_id)
Unregister a mobile device
- Visibility: public
- $mobile_key string - <p>a valid key identifying your mobile application.</p>
- $device_id string - <p>the device id used for the device registration</p>
array MCAPI::gmonkeyAdd(string $id, array $email_address)
Add Golden Monkey(s)
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $email_address array - <p>an array of email addresses (max 50) to attempt to flag as Golden Monkeys</p>
array MCAPI::gmonkeyDel(string $id, array $email_address)
Remove Golden Monkey(s)
- Visibility: public
- $id string - <p>the list id to connect to. Get by calling lists()</p>
- $email_address array - <p>an array of email addresses (max 50) to attempt to remove Golden Monkey status from.</p>
array MCAPI::gmonkeyMembers()
Retrieve all Golden Monkey(s) for an account
- Visibility: public
array MCAPI::gmonkeyActivity()
Retrieve all Activity (opens/clicks) for Golden Monkeys over the past 10 days
- Visibility: public
mixed MCAPI::callMethod()
Internal function - proxy method for certain XML-RPC calls | DO NOT CALL
- Visibility: public
mixed MCAPI::callServer($method, $params)
Actually connect to the server and call the requested methods, parsing the result You should never have to call this function manually
- Visibility: public
- $method mixed
- $params mixed