I've got problem with creating new member in the list using v3 API. I'm sending post request with json data :
url:
https://us10.api.mailchimp.com/3.0/lists/<list-id>/members
headers:
Content-type: application/json
Authorization: apikey <my-api-key>
Json body:
{
"status": "pending",
"email_address": "[email protected]",
"merge_fields": {
"FNAME": "John",
"LNAME": "Smith",
"REFERRER": "referrer",
"REFERRAL": "referral"
}
}
It's based on api docs and tutorials https://teamtreehouse.com/library/mailchimp-api/mailchimp-api/adding-new-members-to-your-list . But every response looks like:
{
"type": "http://kb.mailchimp.com/api/error-docs/400-invalid-resource",
"title": "Invalid Resource",
"status": 400,
"detail": "Your merge fields were invalid.",
"instance": "",
"errors": [
{
"field": "FNAME",
"message": "Please enter a value"
},
{
"field": "LNAME",
"message": "Please enter a value"
},
{
"field": "REFERRAL",
"message": "Please enter a value"
},
{
"field": "REFERRER",
"message": "Please enter a value"
}
]
}
What am I doing wrong? Is it a problem with MailChimp API?