MailChimp API 3.0 Invalid Resource Error

AndroidNewb picture AndroidNewb · Jan 6, 2017 · Viewed 9.3k times · Source

I am simply trying to add a new member to a MailChimp list. But I keep getting the following error and can't quite understand why:

type: http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/
title: Invalid Resource
status: 400
detail: The resource submitted could not be validated. For field-specific details, see the 'errors' array.
instance:
errors:
0:
field:
message: Schema describes object, NULL found instead

This is quite odd because I am sending the exact object in the body as detailed in the exampled from the docs:

{"email_address":"[email protected]", "status":"subscribed"}

I have tried the call in Postman as well the MailChimp Playground. Am I omitting something in the JSON here?

Answer

Yasha Huynh picture Yasha Huynh · Sep 20, 2017

So I was stuck as well, turns out you need to have "merge_fields". Make it an empty object,

{
    "email_address": "[email protected]",
    "status": "subscribed",
    "merge_fields": {}
}