Fixing MailChimp error “Data did not match any of the schemas described in anyOf.”

While PUTing subscribers into MailChimp I got a bunch of “Data did not match any of the schemas described in anyOf.” error responses from the API server.

Tried googling, but with no luck.

Second try was to look at the array (data) that was sent.

Array
(
    [email_address] => info@example.com
    [status_if_new] => subscribed
    [merge_fields] => Array
        (
            [FNAME] => John
            [LNAME] => Doe
            [COMPANY] => 
        )

)

My thought was that the empty merge field COMPANY was the problem.
So after modifying the code to only send not empty merge field data the error disappeared.

Advertisements

About Michal Zuber

Full stack developer, biker and rollerblader. Owner and developer at https://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/
This entry was posted in php, Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s