Back to Documentation Overview
login
public static login(string username, string password)
DEPRECATED: Log into the MailChimp API and return an API Key. There is no reason to call this in a real app, just hard code your API Key from this or http://admin.mailchimp.com/account/api/. By default the oldest one is returned. If you've never logged into the API before, this will create your first API Key.
- Deprecated:
- User a wrapper that supports our datacenters, or hard code your API Key and endpoint
- Section:
- Security Related
- Parameters:
username Your MailChimp user name password Your MailChimp password - Returns:
- string - an API Key for your user account that will be passed into the rest of the API calls
- <?php
- /**
- This Example shows how to Login using the XML-RPC service and do some
- basic error checking.
- Note that we are using the PEAR XML-RPC client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.inc.php';
- try {
- $apikey = $client->login($username,$password);
- } catch (XML_RPC2_FaultException $e){
- }
- ?>
- <?php
- /**
- This Example shows how to use the MCAPI.php class without actually ever needing
- the account Username & Password.
- **/
- require_once 'inc/MCAPI.class.php';
- require_once 'inc/config.inc'; //contains username & password
- if ($api->errorCode){
- } else {
- }
Examples (2)
download example code[1] xml-rpc_login.php
[2] mcapi_login.php
|
Add New Note
User Contributed Notes for
login |
|---|
| Jeff Boes : jeff -at- endpoint -dot- com 2009-11-09 14:43:34 Example Language: perl |
| FYI, the Mail::Chimp::API Perl module (http://search.cpan.org/~dpirotte/Mail-Chimp-0.12/lib/Mail/Chimp/API.pm) supports only the username/password authentication at this time. |