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

gab brunette
gab brunette
875 Points

the output is very different to the one i see in the video...

My output comes out like that which makes it almost unreadable. Am I doing something wrong?

{"id":"cfbaa0b8d0","name":"Teste","contact":{"company":"Chez Victor Beauport","address1":"230 rue montmagny","address2":"","city":"Quebec","state":"QC","zip":"G1n 3a2","country":"CA","phone":""},"permission_reminder":"","use_archive_bar":true,"campaign_defaults":{"from_name":"Gabriel - BeSocial","from_email":"g.brunette@besocialsolutions.com","subject":"","language":"en"},"notify_on_subscribe":"","notify_on_unsubscribe":"","date_created":"2015-05-02T02:11:34+00:00","list_rating":0,"email_type_option":false,"subscribe_url_short":"http://eepurl.com/blCqbf","subscribe_url_long":"http://besocialwifi.us10.list-manage.com/subscribe?u=5dcd574d62837ea6b9bb3b2ba&id=cfbaa0b8d0","beamer_address":"us10-ed0bad108c-683f04b41a@inbound.mailchimp.com","visibility":"pub","modules":[],"stats":{"member_count":4,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":0,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":3,"campaign_last_sent":"","merge_field_count":2,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":25,"click_rate":0,"last_sub_date":"2015-05-02T20:44:05+00:00","last_unsub_date":""},"_links":[{"rel":"self","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"parent","href":"https://us10.api.mailchimp.com/3.0/lists","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Collection.json","schema":"https://us10.api.mailchimp.com/schema/3.0/CollectionLinks/Lists.json"},{"rel":"update","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0","method":"PATCH","schema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"delete","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0","method":"DELETE"},{"rel":"abuse-reports","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/abuse-reports","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Abuse/Collection.json","schema":"https://us10.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Abuse.json"},{"rel":"activity","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/activity","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Activity/Collection.json"},{"rel":"clients","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/clients","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Clients/Collection.json"},{"rel":"growth-history","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/growth-history","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Growth/Collection.json","schema":"https://us10.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Growth.json"},{"rel":"interest-categories","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/interest-categories","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/InterestCategories/Collection.json","schema":"https://us10.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/InterestCategories.json"},{"rel":"members","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/members","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json","schema":"https://us10.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Members.json"},{"rel":"merge-fields","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/merge-fields","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/MergeFields/Collection.json","schema":"https://us10.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/MergeFields.json"},{"rel":"segments","href":"https://us10.api.mailchimp.com/3.0/lists/cfbaa0b8d0/segments","method":"GET","targetSchema":"https://us10.api.mailchimp.com/schema/3.0/Lists/Segments/Collection.json","schema":"https://us10.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Segments.json"}]}Gabriels-MacBook-Air:~ gabrielbrunette-savard$

1 Answer

Nate Ranson
STAFF
Nate Ranson
Treehouse Guest Teacher

Hey Gab!

Sorry about my supremely slow follow-up on this.

I used an extra command at the end of each of my API requests to format it in a human-readable way. After your curl command, you can use the following to format things to look like the video:

YOUR API CURL COMMAND | python -m json.tool

You'll need to include that pipe key to format the response! :)