function MCAPI::MCAPI in Mailchimp 6
Same name and namespace in other branches
- 5.2 MCAPI.class.php \MCAPI::MCAPI()
- 5 MCAPI.class.php \MCAPI::MCAPI()
- 6.2 MCAPI.class.php \MCAPI::MCAPI()
- 7 MCAPI.class.php \MCAPI::MCAPI()
Connect to the MailChimp API for a given list. All MCAPI calls require login before functioning
Parameters
string $username Your MailChimp login user name - always required:
string $password Your MailChimp login password - always required:
File
- ./MCAPI.class.php, line 34 
Class
Code
function MCAPI($username, $password) {
  //do more "caching" of the uuid for those people that keep instantiating this...
  $this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
  if (isset($GLOBALS["mc_api_key"]) && $GLOBALS["mc_api_key"] != "") {
    $this->api_key = $GLOBALS["mc_api_key"];
  }
  else {
    $this->api_key = $this
      ->callServer("login", array(
      "username" => $username,
      "password" => $password,
    ));
    $GLOBALS["mc_api_key"] = $this->api_key;
  }
}