Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MailChimp API 3.0 Invalid Resource Error

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?

like image 625
AndroidNewb Avatar asked Jan 06 '17 15:01

AndroidNewb


1 Answers

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": {}
}
like image 106
Yasha Huynh Avatar answered Sep 17 '22 11:09

Yasha Huynh