PHP code example of mailchimp / marketing

1. Go to this page and download the library: Download mailchimp/marketing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mailchimp / marketing example snippets






$mailchimp = new MailchimpMarketing\ApiClient();

$mailchimp->setConfig([
  'apiKey' => 'YOUR_API_KEY',
  'server' => 'YOUR_SERVER_PREFIX'
]);

$response = $mailchimp->ping->get();
print_r($response);

$mailchimp->setConfig([
  'apiKey' => 'YOUR_API_KEY',
  'server' => 'YOUR_SERVER_PREFIX'
]);

$mailchimp->setConfig([
  'accessToken' => 'YOUR_ACCESS_TOKEN',
  'server' => 'YOUR_SERVER_PREFIX'
]);

git clone [email protected]:mailchimp/mailchimp-marketing-php.git