Craig Rushforth
Craig Rushforth

Reputation: 223

retrieve email address (only) via lists method in Mailchimp API v3.0

I am starting the migration from Mailchimp API 2.0 - 3.0, and am essentially trying to replicate the methods I used before.

One task is to retrieve all of the members email addresses on a particular list

currently I have

$result = $MailChimp->get('/lists/'.$list_id.'/members/');

which returns a members array, but I can't figure out how to add the fields parameter to the url so I only retrieve the fields I want, (eg fname, email address)

Upvotes: 2

Views: 1020

Answers (1)

Craig Rushforth
Craig Rushforth

Reputation: 223

worked it out, its on the first page

http://developer.mailchimp.com/documentation/mailchimp/guides/get-started-with-mailchimp-api-3/

eg, to get the id, email address and merge fields only,...

$result = $MailChimp->get('/lists/'.$list_id.'/members?fields=members.id,members.email_address,members.merge_fields');

Upvotes: 2

Related Questions