Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?