3

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'
]);
shyamantha
  • 77
  • 1
  • 7

2 Answers2

10

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.

boog
  • 472
  • 1
  • 5
  • 23
4

Check out the docs for more info:

https://mailchimp.com/developer/marketing/guides/quick-start/#make-your-first-api-call

"To find the value for the server parameter used in mailchimp.setConfig, log into your Mailchimp account and look at the URL in your browser. You’ll see something like https://us19.admin.mailchimp.com/; the us19 part is the server prefix. Note that your specific value may be different." - Mailchimp.