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 Retrieving List Data

Tony Brackins
Tony Brackins
26,489 Points

Curl Json

Hmm. Curl command didn't work for me (OSX)

curl https://us6.api.mailchimp.com/3.0/lists | json -bash: json: command not found

2 Answers

Hey Tony --

Sorry about any confusion that caused. That "json" command was just an alias I set up to make the results look a little nicer for the videos. If you leave that part out, it should work correctly. However, if you want to organize the response in a more human-readable format, you can use "python -m json.tool" instead of just the "json" command.

Tony Brackins
Tony Brackins
26,489 Points

Ok awesome thx, will give this a try!

Tony Brackins
Tony Brackins
26,489 Points

Hey Nate Ranson , Still getting an error: Tonys-MacBook-Pro:~ tonybrackins$ curl -H “Authorization: apikey APIKEY” https://us6.api.mailchimp.com/3.0/lists curl: (6) Could not resolve host: apikey curl: (6) Could not resolve host: APIKEY” {"type":"http://kb.mailchimp.com/api/error-docs/401-api-key-missing","title":"API Key Missing","status":401,"detail":"Your request did not include an API key.","instance":"APIKEY"}Tonys-MacBook-Pro:~ tonybrackins$

Tony Brackins
Tony Brackins
26,489 Points

I got it. Looks like it was an issue w/ copy/paste formatting

Tony Brackins
Tony Brackins
26,489 Points

I got it. Looks like it was an issue w/ copy/paste formatting