I have tried the API(/metadata/list) of mailChimp as recommended by the official documentation through postman but always got the same error of Invalid_Key. I have getting key from the mailchimp account and it's active right now. Is anyone know that there is some tricky part to call the MailChimp Api's through postman?
Error Response of Postman:
{
"status": "error",
"code": -1,
"name": "Invalid_Key",
"message": "Invalid API key"
"Status Code: 500
}
Official MailChimp Documentation Link
And I have tried the mailchimp client transactional nodeJS code as well which is as following but still got same error as thorugh postman.
const mailchimp = require('@mailchimp/mailchimp_transactional')('API-KEY');
async function callPing() {
const response = await mailchimp.metadata.list();
console.log(response);
}
callPing();
Update
you might be using the API key created from Mailchimp and not mandrillapp.
Mandrill is an add on in Mailchimp, so you are authenticating yourself with mandrill and mandrill will authenticate you to Mailchimp account. So you have to create api key from mandrill and not mailchimp.
Step to create the key:
old answer
curl -X POST \
https://mandrillapp.com/api/1.0/metadata/list \
-d '{"key":""}'
This is the curl for the specific request ,as key is send as body you have to use body>raw>json
And use { "key" : "value"}
You don't have to pass it through authorization.
Postman benefits
In postman this process can be made easy by clicking
Import > using curl and pasting the curl command that is provided as example
It will create the equalent request for you automatically
Generation of code from postman
You can click the link named as code near to the send button, to create code in any language from postman request