Quick Start with Mailchimp Marketing PHP
masterTo get started, ensure you are using PHP 7.2 or above. Initialize the ApiClient, configure it with your credentials, and make a test call using the ping endpoint.
Note that you must provide a server prefix (e.g., us19) so the client can determine the correct host URL.
require_once('/path/to/MailchimpMarketing/vendor/autoload.php');
$mailchimp = new MailchimpMarketing\ApiClient();
$mailchimp->setConfig([
'apiKey' => 'YOUR_API_KEY',
'server' => 'YOUR_SERVER_PREFIX'
]);
$response = $mailchimp->ping->get();
print_r($response);