\MCAPI
Synopsis
class MCAPI
{
- // members
- public string $version = "1.3";
- public $errorMessage;
- public $errorCode;
- public $apiUrl;
- public integer $timeout = 300;
- public integer $chunkSize = 8192;
- public $api_key;
- public boolean $secure = false;
- // methods
- public void MCAPI()
- public void setTimeout()
- public void getTimeout()
- public void useSecure()
- public boolean campaignUnschedule()
- public boolean campaignSchedule()
- public boolean campaignScheduleBatch()
- public boolean campaignResume()
- public boolean campaignPause()
- public boolean campaignSendNow()
- public boolean campaignSendTest()
- public int campaignSegmentTest()
- public string campaignCreate()
- public boolean campaignUpdate()
- public string campaignReplicate()
- public boolean campaignDelete()
- public array campaigns()
- public array campaignStats()
- public array campaignClickStats()
- public array campaignEmailDomainPerformance()
- public array campaignMembers()
- public array campaignHardBounces()
- public array campaignSoftBounces()
- public array campaignUnsubscribes()
- public array campaignAbuseReports()
- public array campaignAdvice()
- public array campaignAnalytics()
- public array campaignGeoOpens()
- public array campaignGeoOpensForCountry()
- public array campaignEepUrlStats()
- public array campaignBounceMessage()
- public array campaignBounceMessages()
- public array campaignEcommOrders()
- public array campaignShareReport()
- public array campaignContent()
- public array campaignTemplateContent()
- public array campaignOpenedAIM()
- public array campaignNotOpenedAIM()
- public array campaignClickDetailAIM()
- public array campaignEmailStatsAIM()
- public array campaignEmailStatsAIMAll()
- public bool campaignEcommOrderAdd()
- public array lists()
- public array listMergeVars()
- public bool listMergeVarAdd()
- public bool listMergeVarUpdate()
- public bool listMergeVarDel()
- public bool listMergeVarReset()
- public struct listInterestGroupings()
- public bool listInterestGroupAdd()
- public bool listInterestGroupDel()
- public bool listInterestGroupUpdate()
- public int listInterestGroupingAdd()
- public bool listInterestGroupingUpdate()
- public bool listInterestGroupingDel()
- public array listWebhooks()
- public bool listWebhookAdd()
- public boolean listWebhookDel()
- public array listStaticSegments()
- public int listStaticSegmentAdd()
- public bool listStaticSegmentReset()
- public bool listStaticSegmentDel()
- public array listStaticSegmentMembersAdd()
- public array listStaticSegmentMembersDel()
- public boolean listSubscribe()
- public boolean listUnsubscribe()
- public boolean listUpdateMember()
- public array listBatchSubscribe()
- public array listBatchUnsubscribe()
- public array listMembers()
- public array listMemberInfo()
- public array listMemberActivity()
- public array listAbuseReports()
- public array listGrowthHistory()
- public array listActivity()
- public array listLocations()
- public array listClients()
- public array templates()
- public array templateInfo()
- public int templateAdd()
- public boolean templateUpdate()
- public boolean templateDel()
- public boolean templateUndel()
- public array getAccountDetails()
- public array getVerifiedDomains()
- public string generateText()
- public string inlineCss()
- public array folders()
- public int folderAdd()
- public bool folderUpdate()
- public bool folderDel()
- public array ecommOrders()
- public bool ecommOrderAdd()
- public bool ecommOrderDel()
- public array listsForEmail()
- public array campaignsForEmail()
- public array chimpChatter()
- public array searchMembers()
- public array searchCampaigns()
- public array apikeys()
- public string apikeyAdd()
- public boolean apikeyExpire()
- public string ping()
- public array deviceRegister()
- public array deviceUnregister()
- public array gmonkeyAdd()
- public array gmonkeyDel()
- public array gmonkeyMembers()
- public array gmonkeyActivity()
- public mixed callMethod()
- public void callServer()
Members
public
-
$apiUrl
Cache the information on the API location on the server -
$api_key
Cache the user api_key so we only have to log in once per client instantiation -
$chunkSize
Default to a 8K chunk size - $errorCode
- $errorMessage
-
$secure
Cache the user api_key so we only have to log in once per client instantiation -
$timeout
Default to a 300 second timeout on server calls - $version
Methods
public
- MCAPI() — Connect to the MailChimp API for a given list.
- apikeyAdd() — Add an API Key to your account. We will generate a new key for you and return it.
- apikeyExpire() — Expire a Specific API Key. Note that if you expire all of your keys, just visit <a href="http://admin.mailchimp.com/account/api" target="_blank">your API dashboard</a> 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...
- apikeys() — Retrieve a list of all MailChimp API Keys for this User
- callMethod() — Internal function - proxy method for certain XML-RPC calls | DO NOT CALL
- callServer() — Actually connect to the server and call the requested methods, parsing the result You should never have to call this function manually
- campaignAbuseReports() — Get all email addresses that complained about a given campaign
- campaignAdvice() — 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
- campaignAnalytics() — Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
- campaignBounceMessage() — Retrieve the most recent full bounce message for a specific email address on the given campaign.
- campaignBounceMessages() — 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
- campaignClickDetailAIM() — Return the list of email addresses that clicked on a given url, and how many times they clicked
- campaignClickStats() — Get an array of the urls being tracked, and their click counts for a given campaign
- campaignContent() — 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
- campaignCreate() — Create a new draft campaign to send. You <strong>can not</strong> have more than 32,000 campaigns in your account.
- campaignDelete() — Delete a campaign. Seriously, "poof, gone!" - be careful!
- campaignEcommOrderAdd() — Attach Ecommerce Order Information to a Campaign. This will generally be used by ecommerce package plugins <a href="http://connect.mailchimp.com/category/ecommerce" target="_blank">provided by us or by 3rd part system developers</a>.
- campaignEcommOrders() — Retrieve the Ecommerce Orders tracked by campaignEcommOrderAdd()
- campaignEepUrlStats() — Retrieve the tracked eepurl mentions on Twitter
- campaignEmailDomainPerformance() — 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.
- campaignEmailStatsAIM() — Given a campaign and email address, return the entire click and open history with timestamps, ordered by time
- campaignEmailStatsAIMAll() — 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.
- campaignGeoOpens() — Retrieve the countries and number of opens tracked for each. Email address are not returned.
- campaignGeoOpensForCountry() — Retrieve the regions and number of opens tracked for a certain country. Email address are not returned.
- campaignHardBounces() — <strong>DEPRECATED</strong> Get all email addresses with Hard Bounces for a given campaign
- campaignMembers() — Get all email addresses the campaign was successfully sent to (ie, no bounces)
- campaignNotOpenedAIM() — Retrieve the list of email addresses that did not open a given campaign
- campaignOpenedAIM() — Retrieve the list of email addresses that opened a given campaign with how many times they opened - note: this AIM function is free and does not actually require the AIM module to be installed
- campaignPause() — Pause an AutoResponder or RSS campaign from sending
- campaignReplicate() — Replicate a campaign.
- campaignResume() — Resume sending an AutoResponder or RSS campaign
- campaignSchedule() — Schedule a campaign to be sent in the future
- campaignScheduleBatch() — Schedule a campaign to be sent in batches sometime in the future. Only valid for "regular" campaigns
- campaignSegmentTest() — Allows one to test their segmentation rules before creating a campaign using them
- campaignSendNow() — Send a given campaign immediately. For RSS campaigns, this will "start" them.
- campaignSendTest() — Send a test of this campaign to the provided email address
- campaignSoftBounces() — <strong>DEPRECATED</strong> Get all email addresses with Soft Bounces for a given campaign
- campaignStats() — Given a list and a campaign, get all the relevant campaign statistics (opens, bounces, clicks, etc.)
- campaignTemplateContent() — Get the HTML template content sections for a campaign. Note that this <strong>will</strong> 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.
- campaignUnschedule() — Unschedule a campaign that is scheduled to be sent in the future
- campaignUnsubscribes() — Get all unsubscribed email addresses for a given campaign
- campaignUpdate() — Update just about any setting for a campaign that has <em>not</em> been sent. See campaignCreate() for details.
- campaigns() — Get the list of campaigns and their details matching the specified filters
- campaignsForEmail() — Retrieve all Campaigns Ids a member was sent
- chimpChatter() — Return the current Chimp Chatter messages for an account.
- deviceRegister() — Register a mobile device
- deviceUnregister() — Unregister a mobile device
- ecommOrderAdd() — Import Ecommerce Order Information to be used for Segmentation. This will generally be used by ecommerce package plugins <a href="http://connect.mailchimp.com/category/ecommerce" target="_blank">provided by us or by 3rd part system developers</a>.
- ecommOrderDel() — Delete Ecommerce Order Information used for segmentation. This will generally be used by ecommerce package plugins <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
- ecommOrders() — Retrieve the Ecommerce Orders for an account
- folderAdd() — Add a new folder to file campaigns or autoresponders in
- folderDel() — Delete a campaign or autoresponder folder. Note that this will simply make campaigns in the folder appear unfiled, they are not removed.
- folderUpdate() — Update the name of a folder for campaigns or autoresponders
- folders() — List all the folders for a user account
- generateText() — 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 <strong>not</strong> save anything to or update any of your lists, campaigns, or templates.
- getAccountDetails() — 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.
- getTimeout()
- getVerifiedDomains() — Retrieve all domains verification records for an account
- gmonkeyActivity() — Retrieve all Activity (opens/clicks) for Golden Monkeys over the past 10 days
- gmonkeyAdd() — Add Golden Monkey(s)
- gmonkeyDel() — Remove Golden Monkey(s)
- gmonkeyMembers() — Retrieve all Golden Monkey(s) for an account
- inlineCss() — Send your HTML content to have the CSS inlined and optionally remove the original styles.
- listAbuseReports() — Get all email addresses that complained about a given campaign
- listActivity() — Access up to the previous 180 days of daily detailed aggregated activity stats for a given list
- listBatchSubscribe() — 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 <em>not</em> 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.
- listBatchUnsubscribe() — Unsubscribe a batch of email addresses to a list
- listClients() — Retrieve the clients that the list's subscribers have been tagged as being used based on user agents seen. Made possible by <a href="http://user-agent-string.info" target="_blank">user-agent-string.info</a>
- listGrowthHistory() — Access the Growth History by Month for a given list.
- listInterestGroupAdd() — Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first group will automatically turn them on.
- listInterestGroupDel() — Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
- listInterestGroupUpdate() — Change the name of an Interest Group
- listInterestGroupingAdd() — Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first grouping will automatically turn them on.
- listInterestGroupingDel() — Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members
- listInterestGroupingUpdate() — Update an existing Interest Grouping
- listInterestGroupings() — Get the list of interest groupings for a given list, including the label, form information, and included groups for each
- listLocations() — Retrieve the locations (countries) that the list's subscribers have been tagged to based on geocoding their IP address
- listMemberActivity() — Get the most recent 100 activities for particular list members (open, click, bounce, unsub, abuse, sent to)
- listMemberInfo() — Get all the information for particular members of a list
- listMembers() — 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 <a href="/export">Export API</a>
- listMergeVarAdd() — Add a new merge tag to a given list
- listMergeVarDel() — 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.
- listMergeVarReset() — Completely resets all data stored in a merge var on a list. All data is removed and this action can not be undone.
- listMergeVarUpdate() — Update most parameters for a merge tag on a given list. You cannot currently change the merge type
- listMergeVars() — Get the list of merge tags for a given list, including their name, tag, and required setting
- listStaticSegmentAdd() — Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> 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.
- listStaticSegmentDel() — Delete a static segment. Note that this will, of course, remove any member affiliations with the segment
- listStaticSegmentMembersAdd() — 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 <strong>will not</strong> subscribe them to the list!
- listStaticSegmentMembersDel() — 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 <strong>will not</strong> unsubscribe them from the list!
- listStaticSegmentReset() — Resets a static segment - removes <strong>all</strong> members from the static segment. Note: does not actually affect list member data
- listStaticSegments() — Retrieve all of the Static Segments for a list.
- listSubscribe() — 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!
- listUnsubscribe() — Unsubscribe the given email address from the list
- listUpdateMember() — 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.
- listWebhookAdd() — Add a new Webhook URL for the given list
- listWebhookDel() — Delete an existing Webhook URL from a given list
- listWebhooks() — Return the Webhooks configured for the given list
- lists() — Retrieve all of the lists defined for your user account
- listsForEmail() — Retrieve all List Ids a member is subscribed to.
- 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.
- searchCampaigns() — Search all campaigns for the specified query terms
- searchMembers() — Search account wide or on a specific list using the specified query terms
- setTimeout()
- templateAdd() — Create a new user template, <strong>NOT</strong> campaign content. These templates can then be applied while creating campaigns.
- templateDel() — Delete (deactivate) a user template
- templateInfo() — Pull details for a specific template to help support editing
- templateUndel() — Undelete (reactivate) a user template
- templateUpdate() — Replace the content of a user template, <strong>NOT</strong> campaign content.
- templates() — Retrieve various templates available in the system, allowing some thing similar to our template gallery to be created.
- useSecure()