Search code examples
mailchimpmailchimp-api-v3

Mailchimp Integration with php


I'm trying integrate Mailchimp for a website in PHP. Below code form Mailchimp documentation and I want to know the value of YOUR_SERVER_PREFIX and how to find that value


$mailchimp = new \MailchimpMarketing\ApiClient();

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

Solution

  • Log into your mailchimp account and look at the URL:

    https://us19.admin.mailchimp.com/

    The server prefix is the "us19" part of the URL.