Integrating with MailChimp - initial data imports

176 views
Skip to first unread message

Rachel Andrew

unread,
Nov 14, 2013, 8:03:44 AM11/14/13
to mailchimp-...@googlegroups.com
 I'm working on an integration between MailChimp and our CMS software Perch. We want to initially grab the list of subscribers for a list and stash them in the database on our side, I'll then set up webhooks from our end to keep the data up to date.

We don't know anything about the user's list and looking at the data returned from the export API it seems that all the custom fields are just dumped in there, what I want to know is which fields can I rely on?

Are your fields - such as EUID always returned with the same headers? So if I put this into an array in PHP with the headers as the key, the value of EUID can be trusted?

Most importantly is email address always the first item in each object returned?

As long as I have enough to identify each user then I think I'm set as we can then use the standard API to keep it updated.

Thanks!

Rachel

Eric Muntz

unread,
Nov 14, 2013, 8:17:47 AM11/14/13
to mailchimp-api-discuss
Hey Rachel - the first line output from the list method in the export API (http://apidocs.mailchimp.com/export/1.0/list.func.php) will be a header row detailing all the fields that will be output.  Using that data, you can determine where in all of the subsequent lines each field is.  There are several fields that will always be returned, regardless of how the list has been customized.  A currently comprehensive list of these fields (note to selves: add to the docs) is...

EMAIL
MEMBER_RATING
OPTIN_TIME
OPTIN_IP
CONFIRM_TIME
CONFIRM_IP
LATITUDE
LONGITUDE
GMTOFF
DSTOFF
TIMEZONE
CC
REGION
LEID
EUID

Many of those can be empty and many other fields will be returned if the list has custom merge fields, the call is made for unsubscribed or cleaned members, etc, etc.  Hope that helps.


--
You received this message because you are subscribed to the Google Groups "MailChimp API Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailchimp-api-di...@googlegroups.com.
To post to this group, send email to mailchimp-...@googlegroups.com.
Visit this group at http://groups.google.com/group/mailchimp-api-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Rachel Andrew

unread,
Nov 14, 2013, 8:41:17 AM11/14/13
to mailchimp-...@googlegroups.com
Thanks for the quick reply :)

So in the lists I have access to the EMAIL header is coming through as "Email address". I'm already processing this into an array using the headers as the key, and all of my lists (however customized) have Headings of Email Address, First Name, Last Name ... then any custom fields ... and then your headings, but they don't seem to include an EMAIL field. The below is directly from a returned export:

["Email Address","First Name","Last Name","EMAIL_TYPE","MEMBER_RATING","OPTIN_TIME","OPTIN_IP","CONFIRM_TIME","CONFIRM_IP","LATITUDE","LONGITUDE","GMTOFF","DSTOFF","TIMEZONE","CC","REGION","LAST_CHANGED","LEID","EUID"]

What I want to know is can that Email Address field be relied on? What about users of other languages etc?

Eric Muntz

unread,
Nov 14, 2013, 9:31:54 AM11/14/13
to mailchimp-api-discuss
Oops, yeah the first field will always be the email address, but user's sure can change the name of the field... yuck.  For now, it's safe to assume the first field is always the email address (users cannot change that behavior), but we'll work on updating a future version of this API (will have to be a new minor build number for backwards compatibility's sake) where the first field will always be hardcoded to the email address with a header that never changes.


Reply all
Reply to author
Forward
0 new messages