Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools MailChimp API MailChimp API Adding New Members to Your List

Saira Chaudhry
Saira Chaudhry
9,526 Points

Create new member does not work

I have tried to follow your code in the video pasted below (with dummy api key and center number for obvious reasons :))

curl -H "Authorization: apikey 000000000000000-usXX" -d '{"email_address":"newemail@example.com","status":"pending","merge_fields":{"FNAME":"test","LNAME":"Treehouse"}}' https://usXX.api.mailchimp.com/3.0/lists/0000avb1c2/members

I am using windows cmd to do this and I get this as an error:

{"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":"94389ad8-aac6-4d86-9520-e6cc447cfbf0","errors":[{"field":"","message":"Schema describes object, NULL found instead"}]}

I don't understand why this isn't working. Is this course so old that the way to create new member using the API is outdated?