Minhazul Islam
Minhazul Islam

Reputation: 81

What is the server prefix for API call in mailchimp.com?

mailchimp.setConfig({
  apiKey: "YOUR_API_KEY",
  server: "YOUR_SERVER_PREFIX",
});

Upvotes: 8

Views: 3848

Answers (4)

Himanshu Sharma
Himanshu Sharma

Reputation: 41

The server prefix is the starting part of the endpoint URL. For example, if you are using MailChimp API, you can check your server prefix by clicking this url: https://us19.admin.mailchimp.com/.

The server prefix will change to your server prefix automatically. For me it is us18.

Hope this helps.

Upvotes: 4

Asra Fud Duha
Asra Fud Duha

Reputation: 630

You can find the SERVER_PREFIX from your API KEY. To see the SERVER_PREFIX from the API KEY, you can write a single code (PHP) like the following.

$serverPrefix = substr($apiKey,strpos($apiKey,'-')+1);

enter image description here

Upvotes: 0

Daniel Beer
Daniel Beer

Reputation: 21

To add to the other comments, it's also the last digits of your API KEY.

Upvotes: 0

Cherlepops
Cherlepops

Reputation: 137

From the documentation:

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.

Upvotes: 10

Related Questions