Back to Documentation Overview
apikeys
public static apikeys(string username, string password, string apikey, boolean expired)
Retrieve a list of all MailChimp API Keys for this User
- Section:
- Security Related
- Parameters:
username Your MailChimp user name password Your MailChimp password apikey Any valid API Key expired optional - whether or not to include expired keys, defaults to false - Returns:
- array - an array of API keys including:
- Returned Fields:
string apikey The api key that can be used string created_at The date the key was created string expired_at The date the key was expired - <?php
- /**
- This Example shows how add an API Key to your account and then retrieve a list
- of all API Keys on your account using XML-RPC.
- Note that we are using the PEAR XML-RPC2 client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.inc.php';
- try {
- $result = $client->apikeyAdd($username,$password, $apikey);
- $result = $client->apikeys($username,$password, $apikey);
- foreach($result as $key){
- }
- } catch (XML_RPC2_FaultException $e){
- }
- <?php
- /**
- This Example shows how to add a new API key using the MCAPI.php class and do
- some basic error checking.
- **/
- require_once 'inc/MCAPI.class.php';
- require_once 'inc/config.inc.php'; //contains apikey
- $retval = $api->apiKeyAdd($username, $password);
- if ($api->errorCode){
- } else {
- }
Examples (2)
download example code[1] xml-rpc_apikeyAdd.php
[2] mcapi_apikeyAdd.php
|
Add New Note
User Contributed Notes for
apikeys |
|---|
| No notes, yet... Will you be the first?? |